Annotation of embedaddon/php/Zend/tests/bug48409.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #48409 (crash when exception is thrown while passing function arguments)
! 3: --FILE--
! 4: <?php
! 5:
! 6: class ABCException extends Exception {}
! 7:
! 8: class BBB
! 9: {
! 10: public function xyz($d, $x)
! 11: {
! 12: if ($x == 34) {
! 13: throw new ABCException;
! 14: }
! 15: return array('foo' => 'xyz');
! 16: }
! 17: }
! 18:
! 19: class CCC
! 20: {
! 21: public function process($p)
! 22: {
! 23: return $p;
! 24: }
! 25: }
! 26:
! 27: class AAA
! 28: {
! 29: public function func()
! 30: {
! 31: $b = new BBB;
! 32: $c = new CCC;
! 33: $i = 34;
! 34: $item = array('foo' => 'bar');
! 35: try {
! 36: $c->process($b->xyz($item['foo'], $i));
! 37: }
! 38: catch(ABCException $e) {
! 39: $b->xyz($item['foo'], $i);
! 40: }
! 41: } // end func();
! 42: }
! 43:
! 44: class Runner
! 45: {
! 46: public function run($x)
! 47: {
! 48: try {
! 49: $x->func();
! 50: }
! 51: catch(ABCException $e) {
! 52: throw new Exception;
! 53: }
! 54: }
! 55: }
! 56:
! 57: try {
! 58: $runner = new Runner;
! 59: $runner->run(new AAA);
! 60: }
! 61: catch(Exception $e) {
! 62: die('Exception thrown');
! 63: }
! 64:
! 65: ?>
! 66: --EXPECT--
! 67: Exception thrown
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>