xref: /PHP-5.5/Zend/tests/generators/bug69419.phpt (revision 95650d09)
1--TEST--
2Bug #69419: Returning compatible sub generator produces a warning
3--FILE--
4<?php
5
6function & genRefInner() {
7    $var = 1;
8    yield $var;
9}
10
11function & genRefOuter() {
12    return genRefInner();
13}
14
15foreach(genRefOuter() as $i) {
16    var_dump($i);
17}
18
19?>
20--EXPECTF--
21Notice: Only variable references should be returned by reference in %s on line %d
22int(1)
23