]> granicus.if.org Git - php/commitdiff
Added test
authorDmitry Stogov <dmitry@zend.com>
Tue, 17 Oct 2017 10:45:46 +0000 (13:45 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 17 Oct 2017 10:45:46 +0000 (13:45 +0300)
Zend/tests/gc_036.phpt [new file with mode: 0644]

diff --git a/Zend/tests/gc_036.phpt b/Zend/tests/gc_036.phpt
new file mode 100644 (file)
index 0000000..67f9a45
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+GC 036: Memleaks in self-referenced array
+--INI--
+zend.enable_gc = 1
+--FILE--
+<?php
+function &foo() {
+       $a = [];
+       $a[] =& $a;
+       return $a;
+}
+function bar() {
+       gc_collect_cycles();
+}
+bar(foo());
+echo "ok\n";
+?>
+--EXPECT--
+ok