summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70805_2.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug70805_2.phpt')
-rw-r--r--Zend/tests/bug70805_2.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/Zend/tests/bug70805_2.phpt b/Zend/tests/bug70805_2.phpt
new file mode 100644
index 0000000000..a9b11684f5
--- /dev/null
+++ b/Zend/tests/bug70805_2.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
+--FILE--
+<?php
+class A {
+}
+
+class B {
+}
+
+class C {
+ public function __destruct() {
+ if (isset($GLOBALS["a"])) {
+ unset($GLOBALS["a"]);
+ }
+ }
+}
+
+$a = new A;
+$a->b = new B;
+$a->b->a = $a;
+
+$i = 0;
+
+while ($i++ < 9998) {
+ $t = [];
+ $t[] = &$t;
+ unset($t);
+}
+$t = [new C];
+$t[] = &$t;
+unset($t);
+
+unset($a);
+var_dump(gc_collect_cycles());
+--EXPECT--
+int(2)