Annotation of embedaddon/php/ext/spl/tests/arrayObject___construct_basic6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: ArrayObject::__construct: check impact of ArrayObject::STD_PROP_LIST on var_dump.
3: --FILE--
4: <?php
5: class MyArrayObject extends ArrayObject {
6: private $priv1 = 'secret1';
7: public $pub1 = 'public1';
8: }
9:
10: $ao = new ArrayObject(array(1,2,3));
11: $ao->p = 1;
12: var_dump($ao);
13:
14: $ao = new ArrayObject(array(1,2,3), ArrayObject::STD_PROP_LIST);
15: $ao->p = 1;
16: var_dump($ao);
17:
18: $ao = new MyArrayObject(array(1,2,3));
19: var_dump($ao);
20:
21: $ao = new MyArrayObject(array(1,2,3), ArrayObject::STD_PROP_LIST);
22: var_dump($ao);
23: ?>
24: --EXPECTF--
25: object(ArrayObject)#1 (2) {
26: ["p"]=>
27: int(1)
28: ["storage":"ArrayObject":private]=>
29: array(3) {
30: [0]=>
31: int(1)
32: [1]=>
33: int(2)
34: [2]=>
35: int(3)
36: }
37: }
38: object(ArrayObject)#2 (2) {
39: ["p"]=>
40: int(1)
41: ["storage":"ArrayObject":private]=>
42: array(3) {
43: [0]=>
44: int(1)
45: [1]=>
46: int(2)
47: [2]=>
48: int(3)
49: }
50: }
51: object(MyArrayObject)#1 (3) {
52: ["priv1":"MyArrayObject":private]=>
53: string(7) "secret1"
54: ["pub1"]=>
55: string(7) "public1"
56: ["storage":"ArrayObject":private]=>
57: array(3) {
58: [0]=>
59: int(1)
60: [1]=>
61: int(2)
62: [2]=>
63: int(3)
64: }
65: }
66: object(MyArrayObject)#2 (3) {
67: ["priv1":"MyArrayObject":private]=>
68: string(7) "secret1"
69: ["pub1"]=>
70: string(7) "public1"
71: ["storage":"ArrayObject":private]=>
72: array(3) {
73: [0]=>
74: int(1)
75: [1]=>
76: int(2)
77: [2]=>
78: int(3)
79: }
80: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>