summaryrefslogtreecommitdiff
path: root/ext/spl/tests/fixedarray_008.phpt
blob: 6d9c9cbf095be386fa9d81edbef059d8075851a2 (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--
SPL: FixedArray: Assigning the itself object testing the reference
--FILE--
<?php

$b = 3;
$a = new SplFixedArray($b);

$a[0] = 1;
$a[1] = 2;
$a[2] = $a;

$a[2][0] = 3;

foreach ($a as $x) {
	if (is_object($x)) {
		var_dump($x[0]);
	} else {
		var_dump($x);
	}
}

var_dump($a->getSize());

?>
--EXPECT--
int(3)
int(2)
int(3)
int(3)