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/classes/clone_004.phpt | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 tests/classes/clone_004.phpt (limited to 'tests/classes/clone_004.phpt') diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt new file mode 100644 index 0000000..2059103 --- /dev/null +++ b/tests/classes/clone_004.phpt @@ -0,0 +1,82 @@ +--TEST-- +ZE2 object cloning, 4 +--FILE-- +a = array(1,2); +$o1->b = array(3,4); +$o1->show(); + +echo "Clone\n"; +$o2 = clone $o1; +$o2->show(); + +echo "Modify\n"; +$o2->a = 5; +$o2->b = 6; +$o2->show(); + +echo "Done\n"; +?> +--EXPECT-- +Original +object(test)#1 (2) { + ["b"]=> + array(2) { + [0]=> + int(3) + [1]=> + int(4) + } + ["a"]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} +Clone +object(test)#2 (2) { + ["b"]=> + array(2) { + [0]=> + int(3) + [1]=> + int(4) + } + ["a"]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} +Modify +object(test)#2 (2) { + ["b"]=> + int(6) + ["a"]=> + int(5) +} +Done -- cgit v1.2.1