exception_008.phpt 657 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Exception in __destruct while exception is pending
  3. --FILE--
  4. <?php
  5. class TestFirst
  6. {
  7. function __destruct() {
  8. throw new Exception("First");
  9. }
  10. }
  11. class TestSecond
  12. {
  13. function __destruct() {
  14. throw new Exception("Second");
  15. }
  16. }
  17. $ar = array(new TestFirst, new TestSecond);
  18. unset($ar);
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. Fatal error: Uncaught Exception: First in %sexception_008.php:%d
  23. Stack trace:
  24. #0 %sexception_008.php(%d): TestFirst->__destruct()
  25. #1 {main}
  26. Next Exception: Second in %sexception_008.php:%d
  27. Stack trace:
  28. #0 %sexception_008.php(%d): TestSecond->__destruct()
  29. #1 {main}
  30. thrown in %sexception_008.php on line %d