php-src/Zend/tests/exception_026.phpt
2021-04-19 18:16:14 +03:00

27 lines
455 B
PHP

--TEST--
Nested exceptions in destructors
--FILE--
<?php
class A {
static $max=0;
function __destruct() {
if (self::$max--<0)
X;
$a = new A;
Y;
}
}
new A;
?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "Y" in %s:8
Stack trace:
#0 %s(11): A->__destruct()
#1 {main}
Next Error: Undefined constant "X" in %s:6
Stack trace:
#0 %s(11): A->__destruct()
#1 {main}
thrown in %s on line 6