summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70805_1.phpt
blob: 035ec6884fc34a06fc26c7382727161348669b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
--INI--
zend.enable_gc = 1
--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++ < 9998) {
	$t = [];
	$t[] = &$t;
	unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t);
unset($a);

var_dump(gc_collect_cycles());
?>
--EXPECT--
int(2)