summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject___construct_basic6.phpt
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
committerSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
commitcd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (patch)
tree1315c623bb7d9dfa8d366fa9cd2c6834ceeb5da5 /ext/spl/tests/arrayObject___construct_basic6.phpt
parent9ea47aab740772adf0c69d8c94b208a464e599ea (diff)
downloadphp-cd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f.tar.gz
Imported Upstream version 5.2.9.dfsg.1upstream/5.2.9.dfsg.1
Diffstat (limited to 'ext/spl/tests/arrayObject___construct_basic6.phpt')
-rw-r--r--ext/spl/tests/arrayObject___construct_basic6.phpt50
1 files changed, 50 insertions, 0 deletions
diff --git a/ext/spl/tests/arrayObject___construct_basic6.phpt b/ext/spl/tests/arrayObject___construct_basic6.phpt
new file mode 100644
index 000000000..150865d5a
--- /dev/null
+++ b/ext/spl/tests/arrayObject___construct_basic6.phpt
@@ -0,0 +1,50 @@
+--TEST--
+SPL: ArrayObject::__construct: check impact of ArrayObject::STD_PROP_LIST on var_dump.
+--FILE--
+<?php
+class MyArrayObject extends ArrayObject {
+ private $priv1 = 'secret1';
+ public $pub1 = 'public1';
+}
+
+$ao = new ArrayObject(array(1,2,3));
+$ao->p = 1;
+var_dump($ao);
+
+$ao = new ArrayObject(array(1,2,3), ArrayObject::STD_PROP_LIST);
+$ao->p = 1;
+var_dump($ao);
+
+$ao = new MyArrayObject(array(1,2,3));
+var_dump($ao);
+
+$ao = new MyArrayObject(array(1,2,3), ArrayObject::STD_PROP_LIST);
+var_dump($ao);
+?>
+--EXPECTF--
+object(ArrayObject)#%d (3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+object(ArrayObject)#%d (1) {
+ ["p"]=>
+ int(1)
+}
+object(MyArrayObject)#%d (3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+object(MyArrayObject)#%d (2) {
+ ["priv1:private"]=>
+ string(7) "secret1"
+ ["pub1"]=>
+ string(7) "public1"
+} \ No newline at end of file