I have a function that gives back a generator. At the moment it uses yield from
:
function foo()
{
$generator = getGenerator();
// some other stuff (no yields!)
yield from $generator;
}
If I replace that yield from
with a simple return
, does that change anything in this case? Maybe in the execution? Or performance? Does yield from
produces a new 'outer' iterator?
I know, in other cases yield from
can be more flexible because I can use it several times and even mix it with simple yield
s, however that doesn't matter for my case.