Download src/php/php-src/Zend/tests/exceptions/bug48409.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug48409.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/exceptions/bug48409.phpt
-
curl -L -o bug48409.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug48409.phpt
1.04 kB
| --TEST-- | |
| Bug #48409 (crash when exception is thrown while passing function arguments) | |
| --FILE-- | |
| class ABCException extends Exception {} | |
| class BBB | |
| { | |
| public function xyz($d, $x) | |
| { | |
| if ($x == 34) { | |
| throw new ABCException; | |
| } | |
| return array('foo' => 'xyz'); | |
| } | |
| } | |
| class CCC | |
| { | |
| public function process($p) | |
| { | |
| return $p; | |
| } | |
| } | |
| class AAA | |
| { | |
| public function func() | |
| { | |
| $b = new BBB; | |
| $c = new CCC; | |
| $i = 34; | |
| $item = array('foo' => 'bar'); | |
| try { | |
| $c->process($b->xyz($item['foo'], $i)); | |
| } | |
| catch(ABCException $e) { | |
| $b->xyz($item['foo'], $i); | |
| } | |
| } // end func(); | |
| } | |
| class Runner | |
| { | |
| public function run($x) | |
| { | |
| try { | |
| $x->func(); | |
| } | |
| catch(ABCException $e) { | |
| throw new Exception; | |
| } | |
| } | |
| } | |
| try { | |
| $runner = new Runner; | |
| $runner->run(new AAA); | |
| } | |
| catch(Exception $e) { | |
| die('Exception thrown'); | |
| } | |
| --EXPECT-- | |
| Exception thrown | |