From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- .../tests/arrayObject_exchangeArray_basic1.phpt | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ext/spl/tests/arrayObject_exchangeArray_basic1.phpt (limited to 'ext/spl/tests/arrayObject_exchangeArray_basic1.phpt') diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic1.phpt b/ext/spl/tests/arrayObject_exchangeArray_basic1.phpt new file mode 100644 index 0000000..988f103 --- /dev/null +++ b/ext/spl/tests/arrayObject_exchangeArray_basic1.phpt @@ -0,0 +1,40 @@ +--TEST-- +SPL: ArrayObject::exchangeArray() and copy-on-write references +--FILE-- +exchangeArray($swapIn); + +$ao['a'] = 'adding element to $ao'; +$swapIn['b'] = 'adding element to $swapIn'; +$ao['c'] = 'adding another element to $ao'; + +echo "\n--> swapIn: "; +var_dump($swapIn); + +echo "\n--> cowRef: "; +var_dump($cowRef); + +echo "\n--> ao: "; +var_dump($ao); +?> +--EXPECTF-- +--> swapIn: array(1) { + ["b"]=> + string(25) "adding element to $swapIn" +} + +--> cowRef: array(0) { +} + +--> ao: object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["a"]=> + string(21) "adding element to $ao" + ["c"]=> + string(29) "adding another element to $ao" + } +} -- cgit v1.2.1