Download src/php/php-src/Zend/tests/generators/bug71297.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 320 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug71297.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/bug71297.phpt
-
curl -L -o bug71297.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug71297.phpt
320 Bytes
| --TEST-- | |
| Bug #71297 (Memory leak with consecutive yield from) | |
| --FILE-- | |
| function foo() { | |
| yield array_fill(0, 10000, 4); | |
| } | |
| function genLeak() { | |
| $i = 0; | |
| while (1) { | |
| yield from foo(); | |
| print $i++; | |
| } | |
| } | |
| $x = 0; | |
| foreach (genLeak() as $i) { | |
| if ($x++ == 3) break; | |
| } | |
| --EXPECT-- | |
| 012 | |