exception_026.phpt 455 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Nested exceptions in destructors
  3. --FILE--
  4. <?php
  5. class A {
  6. static $max=0;
  7. function __destruct() {
  8. if (self::$max--<0)
  9. X;
  10. $a = new A;
  11. Y;
  12. }
  13. }
  14. new A;
  15. ?>
  16. --EXPECTF--
  17. Fatal error: Uncaught Error: Undefined constant "Y" in %s:8
  18. Stack trace:
  19. #0 %s(11): A->__destruct()
  20. #1 {main}
  21. Next Error: Undefined constant "X" in %s:6
  22. Stack trace:
  23. #0 %s(11): A->__destruct()
  24. #1 {main}
  25. thrown in %s on line 6