betz Sat Jan 31 06:45:34 2004 EDT
Modified files:
/phpdoc/en/language operators.xml
Log:
slightly improved example
http://cvs.php.net/diff.php/phpdoc/en/language/operators.xml?r1=1.60&r2=1.61&ty=u
Index: phpdoc/en/language/operators.xml
diff -u phpdoc/en/language/operators.xml:1.60 phpdoc/en/language/operators.xml:1.61
--- phpdoc/en/language/operators.xml:1.60 Fri Jan 30 04:31:29 2004
+++ phpdoc/en/language/operators.xml Sat Jan 31 06:45:33 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.60 $ -->
+<!-- $Revision: 1.61 $ -->
<chapter id="language.operators">
<title>Operators</title>
<simpara>
@@ -814,8 +814,12 @@
$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 @@
When executed, this script will print the following:
<screen role="php">
<![CDATA[
+Union of $a and $b:
array(3) {
["a"]=>
string(5) "apple"
@@ -832,7 +837,15 @@
["c"]=>
string(6) "cherry"
}
-
+Union of $b and $a:
+array(3) {
+ ["a"]=>
+ string(4) "pear"
+ ["b"]=>
+ string(10) "strawberry"
+ ["c"]=>
+ string(6) "cherry"
+}
]]>
</screen>
</para>