Download src/php/php-src/Zend/tests/generators/bug76946.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug76946.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/bug76946.phpt
-
curl -L -o bug76946.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug76946.phpt
337 Bytes
| --TEST-- | |
| Bug #76946: Cyclic reference in generator not detected | |
| --FILE-- | |
| function gen() { | |
| $gen = yield; | |
| foreach ([1, $gen] as $v) { | |
| yield $v; | |
| } | |
| } | |
| function gen2() { | |
| $gen = yield; | |
| $gen + yield; | |
| } | |
| $gen = gen(); | |
| $gen->send($gen); | |
| $gen2 = gen2(); | |
| $gen2->send($gen2); | |
| ===DONE=== | |
| --EXPECT-- | |
| ===DONE=== | |