summaryrefslogtreecommitdiff
path: root/ext/spl/tests/ArrayObject_proptable_canonicalization.phpt
blob: 006a1526026828d2da201afa19db87cadc7864f6 (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
31
32
33
--TEST--
When ArrayObject wraps an object, we should use proptable canonicalization
--FILE--
<?php

$o = new stdClass;
$ao = new ArrayObject($o);
$ao[0] = 1;
var_dump($o);
$ao[0] += 1;
var_dump($o);
var_dump(isset($ao[0]));
var_dump((array) $ao);
unset($ao[0]);
var_dump($o);

?>
--EXPECT--
object(stdClass)#1 (1) {
  ["0"]=>
  int(1)
}
object(stdClass)#1 (1) {
  ["0"]=>
  int(2)
}
bool(true)
array(1) {
  [0]=>
  int(2)
}
object(stdClass)#1 (0) {
}