From d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 3 May 2012 19:56:49 +0800 Subject: [PATCH] Fixed test bug #61892 --- Zend/tests/gc_029.phpt | 2 ++ Zend/tests/gc_029_zts.phpt | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Zend/tests/gc_029_zts.phpt diff --git a/Zend/tests/gc_029.phpt b/Zend/tests/gc_029.phpt index 438053414a..edd231760c 100644 --- a/Zend/tests/gc_029.phpt +++ b/Zend/tests/gc_029.phpt @@ -1,5 +1,7 @@ --TEST-- GC 029: GC and destructors +--SKIPIF-- +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) -- 2.40.0