Download src/php/php-src/Zend/tests/generators/bug74606.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 485 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug74606.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/generators/bug74606.phpt
-
curl -L -o bug74606.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/generators/bug74606.phpt
485 Bytes
| --TEST-- | |
| Bug #74606 (Segfault within try/catch/finally nesting in Generators) | |
| --FILE-- | |
| function gen() { | |
| $array = ["foo"]; | |
| $array[] = "bar"; | |
| foreach ($array as $item) { | |
| try { | |
| try { | |
| yield; | |
| } finally { | |
| echo "fin $item\n"; | |
| } | |
| } catch (\Exception $e) { | |
| echo "catch\n"; | |
| continue; | |
| } | |
| } | |
| } | |
| gen()->throw(new Exception); | |
| --EXPECT-- | |
| fin foo | |
| catch | |
| fin bar | |