mirror of
https://github.com/php/php-src.git
synced 2024-12-19 06:50:17 +08:00
44 lines
655 B
PHP
44 lines
655 B
PHP
--TEST--
|
|
Bug #74053 (Corrupted class entries on shutdown when a destructor spawns another object)
|
|
--FILE--
|
|
<?php
|
|
class b {
|
|
function __destruct() {
|
|
echo "b::destruct\n";
|
|
}
|
|
}
|
|
class a {
|
|
static $b;
|
|
static $new;
|
|
static $max = 10;
|
|
function __destruct() {
|
|
if (self::$max-- <= 0) return;
|
|
echo "a::destruct\n";
|
|
self::$b = new b;
|
|
self::$new[] = new a;
|
|
}
|
|
}
|
|
new a;
|
|
?>
|
|
--EXPECT--
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|