Download src/php/php-src/Zend/tests/generators/clone.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 284 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/clone.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/clone.phpt
-
curl -L -o clone.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/clone.phpt
284 Bytes
| --TEST-- | |
| Generators cannot be cloned | |
| --FILE-- | |
| function gen() { | |
| yield; | |
| } | |
| try { | |
| $gen = gen(); | |
| clone $gen; | |
| } catch (Throwable $e) { | |
| echo $e::class, ": ", $e->getMessage(), PHP_EOL; | |
| } | |
| --EXPECT-- | |
| Error: Trying to clone an uncloneable object of class Generator | |