bug32226.phpt 504 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Bug #32226 (SEGV with exception handler on non existing instance)
  3. --FILE--
  4. <?php
  5. class A
  6. {
  7. public function __construct()
  8. {
  9. set_exception_handler(array($this, 'EH'));
  10. throw new Exception();
  11. }
  12. public function EH()
  13. {
  14. restore_exception_handler();
  15. throw new Exception();
  16. }
  17. }
  18. try
  19. {
  20. $a = new A();
  21. }
  22. catch(Exception $e)
  23. {
  24. echo "Caught\n";
  25. }
  26. ?>
  27. ===DONE===
  28. --EXPECT--
  29. Caught
  30. ===DONE===