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" +} ]]>