mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

Move more low-hanging fruit, creating new directories for the tests for: * comparisons * dynamic calls * error messages * `error_reporting()` * exceptions * `foreach()` * garbage collection * group `use` statements * heredoc and nowdoc * `goto` jumps * late static binding * magic methods * namespaces * numeric literal separators * objects * `settype()` * cleaning of temporary values * `unset()` Additionally, move some tests into the existing subdirectory for `list()` tests. Drive-by fixes of some test numbers in the names of the `goto` tests. Work towards GH-15631
26 lines
455 B
PHP
26 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
|