Skip to content

Commit d74d88f

Browse files
committed
Fixed test bug #61892
1 parent 75d23f5 commit d74d88f

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Zend/tests/gc_029.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
22
GC 029: GC and destructors
3+
--SKIPIF--
4+
<?php if (PHP_ZTS) { print "skip only for no-zts build"; }
35
--INI--
46
zend.enable_gc=1
57
--FILE--

Zend/tests/gc_029_zts.phpt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
GC 029: GC and destructors
3+
--SKIPIF--
4+
<?php if (!PHP_ZTS) { print "skip only for zts build"; }
5+
--INI--
6+
zend.enable_gc=1
7+
--FILE--
8+
<?php
9+
class Foo {
10+
public $bar;
11+
public $x = array(1,2,3);
12+
function __destruct() {
13+
if ($this->bar !== null) {
14+
$this->x = null;
15+
unset($this->bar);
16+
}
17+
}
18+
}
19+
class Bar {
20+
public $foo;
21+
function __destruct() {
22+
if ($this->foo !== null) {
23+
unset($this->foo);
24+
}
25+
}
26+
27+
}
28+
$foo = new Foo();
29+
$bar = new Bar();
30+
$foo->bar = $bar;
31+
$bar->foo = $foo;
32+
unset($foo);
33+
unset($bar);
34+
var_dump(gc_collect_cycles());
35+
?>
36+
--EXPECT--
37+
int(3)

0 commit comments

Comments
 (0)