Download src/php/php-src/Zend/tests/generators/dynamic_call.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 277 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/dynamic_call.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/dynamic_call.phpt
-
curl -L -o dynamic_call.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/dynamic_call.phpt
277 Bytes
| --TEST-- | |
| It's possible to invoke a generator dynamically | |
| --FILE-- | |
| function gen($foo, $bar) { | |
| yield $foo; | |
| yield $bar; | |
| } | |
| $gen = call_user_func('gen', 'bar', 'foo'); | |
| foreach ($gen as $value) { | |
| var_dump($value); | |
| } | |
| --EXPECT-- | |
| string(3) "bar" | |
| string(3) "foo" | |