php-src/Zend/tests/bug76946.phpt
2018-09-28 19:15:19 +02:00

28 lines
337 B
PHP

--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===