diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/spl/tests/arrayObject___construct_basic1.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/spl/tests/arrayObject___construct_basic1.phpt')
-rw-r--r-- | ext/spl/tests/arrayObject___construct_basic1.phpt | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ext/spl/tests/arrayObject___construct_basic1.phpt b/ext/spl/tests/arrayObject___construct_basic1.phpt new file mode 100644 index 0000000..f192cca --- /dev/null +++ b/ext/spl/tests/arrayObject___construct_basic1.phpt @@ -0,0 +1,52 @@ +--TEST-- +SPL: ArrayObject::__construct basic usage. +--FILE-- +<?php +echo "--> No arguments:\n"; +var_dump(new ArrayObject()); + +echo "--> Object argument:\n"; +$a = new stdClass; +$a->p = 'hello'; +var_dump(new ArrayObject($a)); + +echo "--> Array argument:\n"; +var_dump(new ArrayObject(array('key1' => 'val1'))); + +echo "--> Nested ArrayObject argument:\n"; +var_dump(new ArrayObject(new ArrayObject($a))); +?> +--EXPECTF-- +--> No arguments: +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(0) { + } +} +--> Object argument: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(stdClass)#1 (1) { + ["p"]=> + string(5) "hello" + } +} +--> Array argument: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["key1"]=> + string(4) "val1" + } +} +--> Nested ArrayObject argument: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(stdClass)#1 (1) { + ["p"]=> + string(5) "hello" + } + } +} |