summaryrefslogtreecommitdiff
path: root/Zend/tests/bug63734.phpt
blob: b68577d494991323bcdcfa8773f5ef908b49c941 (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
--TEST--
Bug #63734 (Garbage collector can free zvals that are still referenced)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class C {
    public $ref;
    public $ary;
    public function __construct() {
        $this->ref = $this;
        $this->ary[] = 42;
    }
    public function __destruct() {
        global $ary;
        $ary[] = $this->ary[0];
    }
}

$c = new C;
unset($c);
gc_collect_cycles();

var_dump($ary);
?>
--EXPECT--
array(1) {
  [0]=>
  int(42)
}