bug48409.phpt 1.0 KB

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