bug26698.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. --TEST--
  2. Bug #26698 (Thrown exceptions while evaluating 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 ObjectOne
  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 ObjectOne();
  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 ObjectOne();
  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 ObjectOne();
  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. --EXPECT--
  61. Caught: NONE
  62. Caught: NONE
  63. Caught: NONE