Download src/php/php-src/Zend/tests/generators/bug69989_2.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 510 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug69989_2.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/bug69989_2.phpt
-
curl -L -o bug69989_2.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug69989_2.phpt
510 Bytes
| --TEST-- | |
| Collection of some cycles on unfinished generators | |
| --FILE-- | |
| // CV | |
| function gen1() { | |
| $gen = yield; | |
| yield; | |
| } | |
| $gen = gen1(); | |
| $gen->send($gen); | |
| // This | |
| class Test { | |
| public $gen; | |
| public function gen2() { | |
| yield; | |
| } | |
| } | |
| $test = new Test; | |
| $test->gen = $test->gen2(); | |
| // Closure object | |
| $gen3 = (function() use (&$gen3) { | |
| yield; | |
| })(); | |
| // Yield from array | |
| function gen4() { | |
| yield from [yield]; | |
| } | |
| $gen = gen4(); | |
| $gen->send($gen); | |
| ===DONE=== | |
| --EXPECT-- | |
| ===DONE=== | |