xref: /PHP-7.0/Zend/tests/gc_032.phpt (revision 388624d3)
1--TEST--
2GC 032: Crash in GC because of invalid reference counting
3--INI--
4zend.enable_gc=1
5--FILE--
6<?php
7$a = array();
8$b =& $a;
9$a[0] = $a;
10debug_zval_dump($a);
11$a = array(array());
12$b =& $a;
13$a[0][0] = $a;
14debug_zval_dump($a);
15?>
16--EXPECTF--
17array(1) refcount(%d){
18  [0]=>
19  array(1) refcount(%d){
20    [0]=>
21    array(1) refcount(%d){
22      [0]=>
23      *RECURSION*
24    }
25  }
26}
27array(1) refcount(%d){
28  [0]=>
29  array(1) refcount(%d){
30    [0]=>
31    array(1) refcount(%d){
32      [0]=>
33      array(1) refcount(%d){
34        [0]=>
35        array(1) refcount(%d){
36          [0]=>
37          *RECURSION*
38        }
39      }
40    }
41  }
42}
43