mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
28 lines
337 B
PHP
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===
|