summaryrefslogtreecommitdiff
path: root/Zend/tests/gc_035.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-04-17 18:45:46 +0300
committerDmitry Stogov <dmitry@zend.com>2015-04-17 18:45:46 +0300
commit736b7cf4191fab9bd7cb0c5252f6e984da53340d (patch)
tree339fd02486cb9e1909cff9a757db62c7267e74bb /Zend/tests/gc_035.phpt
parent3e203ecea5fb4a79a947a497e785515cb8b3d54a (diff)
downloadphp-git-736b7cf4191fab9bd7cb0c5252f6e984da53340d.tar.gz
Added test
Diffstat (limited to 'Zend/tests/gc_035.phpt')
-rw-r--r--Zend/tests/gc_035.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/gc_035.phpt b/Zend/tests/gc_035.phpt
new file mode 100644
index 0000000000..985264c770
--- /dev/null
+++ b/Zend/tests/gc_035.phpt
@@ -0,0 +1,24 @@
+--TEST--
+GC 035: Lost inner-cycles garbage
+--FILE--
+<?php
+class A {
+ public $a;
+ public $x;
+ function __destruct() {
+ unset($this->x);
+ }
+}
+$a = new A;
+$a->a = $a;
+$a->x = [];
+$a->x[] =& $a->x;
+$a->x[] = $a;
+var_dump(gc_collect_cycles());
+unset($a);
+var_dump(gc_collect_cycles());
+var_dump(gc_collect_cycles());
+--EXPECT--
+int(0)
+int(2)
+int(0)