php-src/Zend/tests/generators/dangling_send_target.phpt
Nikita Popov 1322672c0b Fix dangling send target when using yield from
Also drop some unnecessary TRY_DELREFs -- leftovers from the days
when null was refcounted.
2016-02-11 16:25:16 +01:00

23 lines
325 B
PHP

--TEST--
Yield from does not leave a dangling send target
--FILE--
<?php
function gen1() {
yield from [yield];
}
$gen = gen1();
$gen->send(new stdClass);
function gen2() {
$x = yield;
yield from [1, 2, 3];
}
$gen = gen2();
$gen->send(new stdClass);
$gen->send(new stdClass);
?>
===DONE===
--EXPECT--
===DONE===