bug26698.phpt 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. --TEST--
  2. Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter crash PHP)
  3. --FILE--
  4. <?php
  5. ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine
  6. class Object
  7. {
  8. function getNone()
  9. {
  10. throw new Exception('NONE');
  11. }
  12. }
  13. class Proxy
  14. {
  15. function three($a, $b, $c)
  16. {
  17. }
  18. function callOne()
  19. {
  20. try
  21. {
  22. $res = new Object();
  23. $this->three($res->getNone());
  24. }
  25. catch(Exception $e)
  26. {
  27. echo 'Caught: '.$e->getMessage()."\n";
  28. }
  29. }
  30. function callTwo()
  31. {
  32. try
  33. {
  34. $res = new Object();
  35. $this->three(1, $res->getNone());
  36. }
  37. catch(Exception $e)
  38. {
  39. echo 'Caught: '.$e->getMessage()."\n";
  40. }
  41. }
  42. function callThree()
  43. {
  44. try
  45. {
  46. $res = new Object();
  47. $this->three(1, 2, $res->getNone());
  48. }
  49. catch(Exception $e)
  50. {
  51. echo 'Caught: '.$e->getMessage()."\n";
  52. }
  53. }
  54. }
  55. $p = new Proxy();
  56. $p->callOne();
  57. $p->callTwo();
  58. $p->callThree();
  59. ?>
  60. ===DONE===
  61. --EXPECT--
  62. Caught: NONE
  63. Caught: NONE
  64. Caught: NONE
  65. ===DONE===