bug53511.phpt 690 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Bug #53511 (Exceptions are lost in case an exception is thrown in catch operator)
  3. --FILE--
  4. <?php
  5. class Foo {
  6. function __destruct() {
  7. throw new Exception("ops 1");
  8. }
  9. }
  10. function test() {
  11. $e = new Foo();
  12. try {
  13. throw new Exception("ops 2");
  14. } catch (Exception $e) {
  15. echo $e->getMessage()."\n";
  16. }
  17. }
  18. test();
  19. echo "bug\n";
  20. --EXPECTF--
  21. Fatal error: Uncaught exception 'Exception' with message 'ops 2' in %sbug53511.php:11
  22. Stack trace:
  23. #0 %sbug53511.php(17): test()
  24. #1 {main}
  25. Next exception 'Exception' with message 'ops 1' in %sbug53511.php:4
  26. Stack trace:
  27. #0 %sbug53511.php(12): Foo->__destruct()
  28. #1 %sbug53511.php(17): test()
  29. #2 {main}
  30. thrown in %sbug53511.php on line 4