summaryrefslogtreecommitdiff
path: root/Zend/tests/gc_008.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/gc_008.phpt')
-rw-r--r--Zend/tests/gc_008.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Zend/tests/gc_008.phpt b/Zend/tests/gc_008.phpt
new file mode 100644
index 0000000..289d581
--- /dev/null
+++ b/Zend/tests/gc_008.phpt
@@ -0,0 +1,23 @@
+--TEST--
+GC 008: Unreferensed object cycle
+--INI--
+zend.enable_gc=1
+--FILE--
+<?php
+$a = new stdClass();
+$a->a = new stdClass();
+$a->a->a = $a->a;
+var_dump($a->a);
+var_dump(gc_collect_cycles());
+unset($a);
+var_dump(gc_collect_cycles());
+echo "ok\n"
+?>
+--EXPECTF--
+object(stdClass)#%d (1) {
+ ["a"]=>
+ *RECURSION*
+}
+int(0)
+int(1)
+ok