blob: b50031aba656fac08424f3153c4a25f71b720742 (
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
|
--TEST--
Bug #77345 (Segmentation faults stack overflow in cyclic garbage collector) (Bug #77427)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class Node
{
/** @var Node */
public $previous;
/** @var Node */
public $next;
}
var_dump(gc_enabled());
var_dump('start');
$firstNode = new Node();
$firstNode->previous = $firstNode;
$firstNode->next = $firstNode;
$circularDoublyLinkedList = $firstNode;
for ($i = 0; $i < 200000; $i++) {
$currentNode = $circularDoublyLinkedList;
$nextNode = $circularDoublyLinkedList->next;
$newNode = new Node();
$newNode->previous = $currentNode;
$currentNode->next = $newNode;
$newNode->next = $nextNode;
$nextNode->previous = $newNode;
$circularDoublyLinkedList = $nextNode;
}
var_dump('end');
?>
--EXPECT--
bool(true)
string(5) "start"
string(3) "end"
|