com php-src: Fixed test bug #61892: Zend/tests/gc_029 .phpt Zend/tests/gc_029_zts.phpt
| From: | Xinchen Hui | Date: | Thu, 03 May 2012 11:56:49 +0000 |
| Subject: | com php-src: Fixed test bug #61892: Zend/tests/gc_029 .phpt Zend/tests/gc_029_zts.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-68926@lists.php.net to get a copy of this message | ||
Commit: d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c
Author: Xinchen Hui <laruence@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)