1--TEST-- 2Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash) 3--FILE-- 4<?php 5class A { 6} 7 8class B { 9} 10 11class C { 12 public function __destruct() { 13 if (isset($GLOBALS["a"])) { 14 unset($GLOBALS["array"]); 15 unset($GLOBALS["a"]); 16 } 17 } 18} 19 20$a = new A; 21$a->b = new B; 22$a->b->a = $a; 23 24$i = 0; 25 26$c = new A; 27$array = array($c); 28unset($c); 29 30while ($i++ < 9997) { 31 $t = []; 32 $t[] = &$t; 33 unset($t); 34} 35$t = [new C]; 36$t[] = &$t; 37unset($t); 38unset($a); 39 40var_dump(gc_collect_cycles()); 41?> 42--EXPECT-- 43int(2) 44