xref: /PHP-8.1/Zend/tests/bug38469.phpt (revision f8d79582)
1--TEST--
2Bug #38469 (Unexpected creation of cycle)
3--FILE--
4<?php
5$a = array();
6$a[0] = $a;
7var_dump($a);
8$b = array(array());
9$b[0][0] = $b;
10var_dump($b);
11
12function f() {
13    $a = array();
14    $a[0] = $a;
15    var_dump($a);
16    $b = array(array());
17    $b[0][0] = $b;
18    var_dump($b);
19}
20f();
21?>
22--EXPECT--
23array(1) {
24  [0]=>
25  array(0) {
26  }
27}
28array(1) {
29  [0]=>
30  array(1) {
31    [0]=>
32    array(1) {
33      [0]=>
34      array(0) {
35      }
36    }
37  }
38}
39array(1) {
40  [0]=>
41  array(0) {
42  }
43}
44array(1) {
45  [0]=>
46  array(1) {
47    [0]=>
48    array(1) {
49      [0]=>
50      array(0) {
51      }
52    }
53  }
54}
55