>> This would require a yield to syntax, which doesn't exist.
There is however the 'yield from' statement.
replies(3):
There is however the 'yield from' statement.
function numbers() {
yield from [1,2,3];
yield from [4,5,6];
};
foreach (numbers() as $k => $v) { echo "$k => $v\n"; }
0 => 1
1 => 2
2 => 3
0 => 4
1 => 5
2 => 6
``` foreach (new LimitIterator($generator, 0, 3) as $value) { echo $value; } ```