bug70944.phpt 716 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
  3. --FILE--
  4. <?php
  5. try {
  6. $e = new Exception("Foo");
  7. try {
  8. throw new Exception("Bar", 0, $e);
  9. } finally {
  10. throw $e;
  11. }
  12. } catch (Exception $e) {
  13. var_dump((string)$e);
  14. }
  15. try {
  16. $e = new Exception("Foo");
  17. try {
  18. throw new Exception("Bar", 0, $e);
  19. } finally {
  20. throw new Exception("Dummy", 0, $e);
  21. }
  22. } catch (Exception $e) {
  23. var_dump((string)$e);
  24. }
  25. ?>
  26. --EXPECTF--
  27. string(%d) "Exception: Foo in %sbug70944.php:%d
  28. Stack trace:
  29. #0 {main}"
  30. string(%d) "Exception: Foo in %sbug70944.php:%d
  31. Stack trace:
  32. #0 {main}
  33. Next Exception: Dummy in %sbug70944.php:%d
  34. Stack trace:
  35. #0 {main}"