summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70805_1.phpt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-11-03 17:53:56 -0800
committerXinchen Hui <laruence@gmail.com>2015-11-03 17:53:56 -0800
commit2f2653aa7758cd586f1daff288146740dd5fa61b (patch)
treef95768ca50b406ec74a45576a24db29a3ee803d3 /Zend/tests/bug70805_1.phpt
parentd7ff107654acb5dc682773bb0b369a7e593056d8 (diff)
downloadphp-git-2f2653aa7758cd586f1daff288146740dd5fa61b.tar.gz
Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite)
Diffstat (limited to 'Zend/tests/bug70805_1.phpt')
-rw-r--r--Zend/tests/bug70805_1.phpt43
1 files changed, 43 insertions, 0 deletions
diff --git a/Zend/tests/bug70805_1.phpt b/Zend/tests/bug70805_1.phpt
new file mode 100644
index 0000000000..0225b4ce82
--- /dev/null
+++ b/Zend/tests/bug70805_1.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
+--FILE--
+<?php
+class A {
+}
+
+class B {
+}
+
+class C {
+ public function __destruct() {
+ if (isset($GLOBALS["a"])) {
+ unset($GLOBALS["array"]);
+ unset($GLOBALS["a"]);
+ }
+ }
+}
+
+$a = new A;
+$a->b = new B;
+$a->b->a = $a;
+
+$i = 0;
+
+$c = new A;
+$array = array($c);
+unset($c);
+
+while ($i++ < 9997) {
+ $t = [];
+ $t[] = &$t;
+ unset($t);
+}
+$t = [new C];
+$t[] = &$t;
+unset($t);
+unset($a);
+
+var_dump(gc_collect_cycles());
+?>
+--EXPECT--
+int(2)