bug53511.phpt 580 B

1234567891011121314151617181920212223242526272829
  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. ?>
  21. --EXPECTF--
  22. Fatal error: Uncaught Exception: ops 1 in %sbug53511.php:4
  23. Stack trace:
  24. #0 %sbug53511.php(12): Foo->__destruct()
  25. #1 %sbug53511.php(17): test()
  26. #2 {main}
  27. thrown in %sbug53511.php on line 4