Download src/php/php-src/Zend/tests/exceptions/bug30725.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug30725.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/exceptions/bug30725.phpt
-
curl -L -o bug30725.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug30725.phpt
413 Bytes
| --TEST-- | |
| Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach) | |
| --FILE-- | |
| class Test implements IteratorAggregate | |
| { | |
| function getIterator(): Traversable | |
| { | |
| throw new Exception(); | |
| } | |
| } | |
| try | |
| { | |
| $it = new Test; | |
| foreach($it as $v) | |
| { | |
| echo "Fail\n"; | |
| } | |
| echo "Wrong\n"; | |
| } | |
| catch(Exception $e) | |
| { | |
| echo "Caught\n"; | |
| } | |
| --EXPECT-- | |
| Caught | |