1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
--TEST-- Bug #76946: Cyclic reference in generator not detected --FILE-- <?php function gen() { $gen = yield; foreach ([1, $gen] as $v) { yield $v; } } function gen2() { $gen = yield; $gen + yield; } $gen = gen(); $gen->send($gen); $gen2 = gen2(); $gen2->send($gen2); ?> ===DONE=== --EXPECT-- ===DONE===