mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
23 lines
363 B
PHP
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)
|