Download src/php/php-src/Zend/tests/generators/bug69419.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug69419.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/bug69419.phpt
-
curl -L -o bug69419.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug69419.phpt
363 Bytes
| --TEST-- | |
| Bug #69419: Returning compatible sub generator produces a warning | |
| --FILE-- | |
| 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) | |