php-src/Zend/tests/generators/bug69419.phpt
2015-04-14 16:35:23 +02:00

23 lines
363 B
PHP

--TEST--
Bug #69419: Returning compatible sub generator produces a warning
--FILE--
<?php
function & genRefInner() {
$var = 1;
yield $var;
}
function & genRefOuter() {
return genRefInner();
}
foreach(genRefOuter() as $i) {
var_dump($i);
}
?>
--EXPECTF--
Notice: Only variable references should be returned by reference in %s on line %d
int(1)