summaryrefslogtreecommitdiff
path: root/Zend/tests/bug74053.phpt
blob: b1936a58e9e26ac5d8e13dd23e3ab7555e2fd991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--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