xref: /PHP-8.1/ext/spl/tests/fixedarray_008.phpt (revision f8d79582)
1--TEST--
2SPL: FixedArray: Assigning the itself object testing the reference
3--FILE--
4<?php
5
6$b = 3;
7$a = new SplFixedArray($b);
8
9$a[0] = 1;
10$a[1] = 2;
11$a[2] = $a;
12
13$a[2][0] = 3;
14
15foreach ($a as $x) {
16    if (is_object($x)) {
17        var_dump($x[0]);
18    } else {
19        var_dump($x);
20    }
21}
22
23var_dump($a->getSize());
24
25?>
26--EXPECT--
27int(3)
28int(2)
29int(3)
30int(3)
31