cvs: /phpdoc/language operators.sgml
| From: | Torben Wilson | Date: | Mon, 15 Nov 1999 09:32:19 +0000 |
| Subject: | cvs: /phpdoc/language operators.sgml | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12558@lists.php.net to get a copy of this message | ||
cslawi Mon Nov 15 04:32:19 1999 EDT
Modified files:
/phpdoc/language operators.sgml
Log:
Added note about passing by value and reference in PHP3 and 4.
Index: phpdoc/language/operators.sgml
diff -u phpdoc/language/operators.sgml:1.3 phpdoc/language/operators.sgml:1.4
--- phpdoc/language/operators.sgml:1.3 Wed Oct 20 18:52:31 1999
+++ phpdoc/language/operators.sgml Mon Nov 15 04:32:18 1999
@@ -97,7 +97,20 @@
$b = "Hello ";
$b .= "There!"; // sets $b to "Hello There!", just like $b = $b .
"There!";
</programlisting></informalexample>
- </para></sect1>
+ </para>
+
+ <para>
+ Note that the assignment copies the original variable to the new
+ one (assignment by value), so changes to one will not affect the
+ other. This may also have relevance if you need to copy something
+ like a large array inside a tight loop. PHP4 supports assignment
+ by reference, using the <computeroutput>$var =
+ &$othervar;</computeroutput> syntax, but this is not possible
+ in PHP3. 'Assignment by reference' means that both variables end
+ up pointing at the same data, and nothing is copied anywhere.
+ </para>
+
+</sect1>
<sect1 id="language.operators.bitwise">
<title>Bitwise Operators</title>