svn: /phpdoc/en/trunk/language/control-structures/ return.xml
| From: | Torben Wilson | Date: | Wed, 26 Aug 2009 05:59:59 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/control-structures/ return.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4757@lists.php.net to get a copy of this message | ||
torben Wed, 26 Aug 2009 05:59:59 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287728
Log:
Clarified what will happen if you call return using parentheses but no argument.
Addresses Bug #49346.
Note: perhaps control structure documentation should be normalized to cover this sort of thing.
Bug: http://bugs.php.net/49346 (Open) using return() with an
empty argument list is causing in a parser error
Changed paths:
U phpdoc/en/trunk/language/control-structures/return.xml
Modified: phpdoc/en/trunk/language/control-structures/return.xml
===================================================================
--- phpdoc/en/trunk/language/control-structures/return.xml 2009-08-26 05:47:31 UTC (rev 287727)
+++ phpdoc/en/trunk/language/control-structures/return.xml 2009-08-26 05:59:59 UTC (rev 287728)
@@ -40,6 +40,14 @@
</note>
<note>
<simpara>
+ If no parameter is supplied, then the parentheses must be omitted
+ and <literal>NULL</literal> will be
+ returned. Calling <function>return</function> with parentheses but
+ with no arguments will result in a parse error.
+ </simpara>
+ </note>
+ <note>
+ <simpara>
You should <emphasis>never</emphasis> use parentheses around your return
variable when returning by reference, as this will not work. You can
only return variables by reference, not the result of a statement. If