Annotation of embedaddon/php/ext/spl/tests/arrayObject___construct_basic1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: ArrayObject::__construct basic usage.
3: --FILE--
4: <?php
5: echo "--> No arguments:\n";
6: var_dump(new ArrayObject());
7:
8: echo "--> Object argument:\n";
9: $a = new stdClass;
10: $a->p = 'hello';
11: var_dump(new ArrayObject($a));
12:
13: echo "--> Array argument:\n";
14: var_dump(new ArrayObject(array('key1' => 'val1')));
15:
16: echo "--> Nested ArrayObject argument:\n";
17: var_dump(new ArrayObject(new ArrayObject($a)));
18: ?>
19: --EXPECTF--
20: --> No arguments:
21: object(ArrayObject)#1 (1) {
22: ["storage":"ArrayObject":private]=>
23: array(0) {
24: }
25: }
26: --> Object argument:
27: object(ArrayObject)#2 (1) {
28: ["storage":"ArrayObject":private]=>
29: object(stdClass)#1 (1) {
30: ["p"]=>
31: string(5) "hello"
32: }
33: }
34: --> Array argument:
35: object(ArrayObject)#2 (1) {
36: ["storage":"ArrayObject":private]=>
37: array(1) {
38: ["key1"]=>
39: string(4) "val1"
40: }
41: }
42: --> Nested ArrayObject argument:
43: object(ArrayObject)#2 (1) {
44: ["storage":"ArrayObject":private]=>
45: object(ArrayObject)#3 (1) {
46: ["storage":"ArrayObject":private]=>
47: object(stdClass)#1 (1) {
48: ["p"]=>
49: string(5) "hello"
50: }
51: }
52: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>