summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject___construct_basic7.phpt
blob: dd10b5fb6b996210e33b76f510e69c5c202b7037 (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
34
--TEST--
SPL: ArrayObject::__construct: Using object with shared properties
--FILE--
<?php
$y = 2;
$x = 1;
$a = array($y, $x);
$o = (object)$a;
$ao = new ArrayObject($o);
$ao->asort();
var_dump($a, $o, $ao);
?>
--EXPECT--
array(2) {
  [0]=>
  int(2)
  [1]=>
  int(1)
}
object(stdClass)#1 (2) {
  ["1"]=>
  int(1)
  ["0"]=>
  int(2)
}
object(ArrayObject)#2 (1) {
  ["storage":"ArrayObject":private]=>
  object(stdClass)#1 (2) {
    ["1"]=>
    int(1)
    ["0"]=>
    int(2)
  }
}