Commit: d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c Author: Xinchen Hui <larue...@php.net> Thu, 3 May 2012 19:56:49 +0800 Parents: 75d23f571479b15e48e3f51aa6ec12759f5fef01 Branches: PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c Log: Fixed test bug #61892 Bugs: https://bugs.php.net/61892 Changed paths: M Zend/tests/gc_029.phpt A Zend/tests/gc_029_zts.phpt Diff: diff --git a/Zend/tests/gc_029.phpt b/Zend/tests/gc_029.phpt index 4380534..edd2317 100644 --- a/Zend/tests/gc_029.phpt +++ b/Zend/tests/gc_029.phpt @@ -1,5 +1,7 @@ --TEST-- GC 029: GC and destructors +--SKIPIF-- +<?php if (PHP_ZTS) { print "skip only for no-zts build"; } --INI-- zend.enable_gc=1 --FILE-- diff --git a/Zend/tests/gc_029_zts.phpt b/Zend/tests/gc_029_zts.phpt new file mode 100644 index 0000000..fc77e1f --- /dev/null +++ b/Zend/tests/gc_029_zts.phpt @@ -0,0 +1,37 @@ +--TEST-- +GC 029: GC and destructors +--SKIPIF-- +<?php if (!PHP_ZTS) { print "skip only for zts build"; } +--INI-- +zend.enable_gc=1 +--FILE-- +<?php +class Foo { + public $bar; + public $x = array(1,2,3); + function __destruct() { + if ($this->bar !== null) { + $this->x = null; + unset($this->bar); + } + } +} +class Bar { + public $foo; + function __destruct() { + if ($this->foo !== null) { + unset($this->foo); + } + } + +} +$foo = new Foo(); +$bar = new Bar(); +$foo->bar = $bar; +$bar->foo = $foo; +unset($foo); +unset($bar); +var_dump(gc_collect_cycles()); +?> +--EXPECT-- +int(3) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php