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