Download src/php/php-src/Zend/tests/exceptions/bug26698.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug26698.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/exceptions/bug26698.phpt
-
curl -L -o bug26698.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug26698.phpt
1.24 kB
| --TEST-- | |
| Bug #26698 (Thrown exceptions while evaluating argument to pass as parameter crash PHP) | |
| --FILE-- | |
| ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine | |
| class ObjectOne | |
| { | |
| function getNone() | |
| { | |
| throw new Exception('NONE'); | |
| } | |
| } | |
| class Proxy | |
| { | |
| function three($a, $b, $c) | |
| { | |
| } | |
| function callOne() | |
| { | |
| try | |
| { | |
| $res = new ObjectOne(); | |
| $this->three($res->getNone()); | |
| } | |
| catch(Exception $e) | |
| { | |
| echo 'Caught: '.$e->getMessage()."\n"; | |
| } | |
| } | |
| function callTwo() | |
| { | |
| try | |
| { | |
| $res = new ObjectOne(); | |
| $this->three(1, $res->getNone()); | |
| } | |
| catch(Exception $e) | |
| { | |
| echo 'Caught: '.$e->getMessage()."\n"; | |
| } | |
| } | |
| function callThree() | |
| { | |
| try | |
| { | |
| $res = new ObjectOne(); | |
| $this->three(1, 2, $res->getNone()); | |
| } | |
| catch(Exception $e) | |
| { | |
| echo 'Caught: '.$e->getMessage()."\n"; | |
| } | |
| } | |
| } | |
| $p = new Proxy(); | |
| $p->callOne(); | |
| $p->callTwo(); | |
| $p->callThree(); | |
| --EXPECT-- | |
| Caught: NONE | |
| Caught: NONE | |
| Caught: NONE | |