summaryrefslogtreecommitdiff
path: root/ext/spl/tests/ArrayObject_std_props_no_recursion.phpt
blob: 193e9725300571be4c8bf1799d5cd80f5cb6821c (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
--TEST--
Don't recurse into USE_OTHER when checking for STD_PROP_LIST
--FILE--
<?php

$a = new ArrayObject([1, 2, 3], ArrayObject::STD_PROP_LIST);
$a->prop = 'a';
$b = new ArrayObject($a, 0);
$b->prop = 'b';
var_dump((array) $b);
$c = new ArrayObject($a);
$c->prop = 'c';
var_dump((array) $c);

?>
--EXPECT--
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
array(1) {
  ["prop"]=>
  string(1) "c"
}