From fe882e3c7221ca6ec869ce0646fb389d69057593 Mon Sep 17 00:00:00 2001 From: Friedhelm Betz Date: Sat, 31 Jan 2004 11:45:33 +0000 Subject: [PATCH] slightly improved example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150211 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/operators.xml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/language/operators.xml b/language/operators.xml index b51af9865d..dc699cd630 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -1,5 +1,5 @@ - + Operators @@ -814,8 +814,12 @@ $a .= "World!"; // now $a contains "Hello World!" $a = array("a" => "apple", "b" => "banana"); $b = array("a" => "pear", "b" => "strawberry", "c" => "cherry"); -$c = $a + $b; +$c = $a + $b; // Union of $a and $b +echo "Union of \$a and \$b: \n"; +var_dump($c); +$c = $b + $a; // Union of $b and $a +echo "Union of \$b and \$a: \n"; var_dump($c); ?> ]]> @@ -824,6 +828,7 @@ var_dump($c); When executed, this script will print the following: string(5) "apple" @@ -832,7 +837,15 @@ array(3) { ["c"]=> string(6) "cherry" } - +Union of $b and $a: +array(3) { + ["a"]=> + string(4) "pear" + ["b"]=> + string(10) "strawberry" + ["c"]=> + string(6) "cherry" +} ]]>