cvs: phpdoc /en/language control-structures.xml operators.xml references.xml

From: Date: Wed, 06 Jul 2005 14:26:31 +0000
Subject: cvs: phpdoc /en/language control-structures.xml operators.xml references.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969368957@lists.php.net to get a copy of this message
dbs Wed Jul 6 10:26:31 2005 EDT Modified files: /phpdoc/en/language control-structures.xml operators.xml references.xml Log: Editorial pass for latest by-reference updates. http://cvs.php.net/diff.php/phpdoc/en/language/control-structures.xml?r1=1.120&r2=1.121&ty=u Index: phpdoc/en/language/control-structures.xml diff -u phpdoc/en/language/control-structures.xml:1.120 phpdoc/en/language/control-structures.xml:1.121 --- phpdoc/en/language/control-structures.xml:1.120 Wed Jul 6 08:52:03 2005 +++ phpdoc/en/language/control-structures.xml Wed Jul 6 10:26:26 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.120 $ --> +<!-- $Revision: 1.121 $ --> <chapter id="language.control-structures"> <title>Control Structures</title> @@ -1202,7 +1202,7 @@ only return variables by reference, not the result of a statement. If you use <literal>return ($a);</literal> then you're not returning a variable, but the result of the expression <literal>($a)</literal> - (which is ofcourse the value of <varname>$a</varname>. + (which is, of course, the value of <varname>$a</varname>. </simpara> </note> </para> http://cvs.php.net/diff.php/phpdoc/en/language/operators.xml?r1=1.90&r2=1.91&ty=u Index: phpdoc/en/language/operators.xml diff -u phpdoc/en/language/operators.xml:1.90 phpdoc/en/language/operators.xml:1.91 --- phpdoc/en/language/operators.xml:1.90 Wed Jul 6 08:52:03 2005 +++ phpdoc/en/language/operators.xml Wed Jul 6 10:26:29 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.90 $ --> +<!-- $Revision: 1.91 $ --> <chapter id="language.operators"> <title>Operators</title> <simpara> @@ -677,7 +677,7 @@ <simpara> Please note that the ternary operator is a statement, and that it doesn't evaluate to a variable, but to the result of a statement. This - is important to know if you want to return a variable by references. + is important to know if you want to return a variable by reference. The statement <literal>return $var == 42 ? $a : $b;</literal> in a return-by-reference function will therefore not work and a warning is issued in later PHP versions. http://cvs.php.net/diff.php/phpdoc/en/language/references.xml?r1=1.41&r2=1.42&ty=u Index: phpdoc/en/language/references.xml diff -u phpdoc/en/language/references.xml:1.41 phpdoc/en/language/references.xml:1.42 --- phpdoc/en/language/references.xml:1.41 Wed Jul 6 08:52:04 2005 +++ phpdoc/en/language/references.xml Wed Jul 6 10:26:29 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.41 $ --> +<!-- $Revision: 1.42 $ --> <chapter id="language.references"> <title>References Explained</title> @@ -259,7 +259,7 @@ deprecated when you use a &amp; in <literal>foo(&amp;$a);</literal>. </para> <para> - Following things can be passed by reference: + The following things can be passed by reference: <itemizedlist> <listitem> <simpara> @@ -325,9 +325,9 @@ Returning by-reference is useful when you want to use a function to find which variable a reference should be bound to. Do <emphasis>not</emphasis> use return-by-reference to increase performance, the - engine is smart enough to optimize this yourself. Only return references - when you have a valid technical reason to do it! When - returning references, use this syntax: + engine is smart enough to optimize this on its own. Only return references + when you have a valid technical reason to do it! To + return references, use this syntax: <informalexample> <programlisting role="php"> <![CDATA[ @@ -361,7 +361,7 @@ <simpara> If you try to return a reference from a function with the syntax: <literal>return ($found_var);</literal> this will <emphasis>not</emphasis> - work as you now try to return the result of an + work as you are attempting to return the result of an <emphasis>expression</emphasis>, and not a variable, by reference. You can only return variables by reference from a function - nothing else. </simpara>

« previous php.doc (#969368957) next »