Download src/php/php-src/Zend/tests/generators/bug69740.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 409 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug69740.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/bug69740.phpt
-
curl -L -o bug69740.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug69740.phpt
409 Bytes
| --TEST-- | |
| Bug #69740: finally in generator (yield) swallows exception in iteration | |
| --FILE-- | |
| function generate() { | |
| try { | |
| yield 1; | |
| yield 2; | |
| } finally { | |
| echo "finally\n"; | |
| } | |
| } | |
| foreach (generate() as $i) { | |
| echo $i, "\n"; | |
| throw new Exception(); | |
| } | |
| --EXPECTF-- | |
| 1 | |
| finally | |
| Fatal error: Uncaught Exception in %s:%d | |
| Stack trace: | |
| #0 {main} | |
| thrown in %s on line %d | |