2017-02-07 22:19:16 +08:00
|
|
|
--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;
|
|
|
|
?>
|
2017-02-10 15:31:43 +08:00
|
|
|
--EXPECT--
|
2017-02-07 22:19:16 +08:00
|
|
|
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
|