cvs: phpdoc /en/reference/strings/functions echo.xml
| From: | Sean Coates | Date: | Tue, 09 Aug 2005 17:38:33 +0000 |
| Subject: | cvs: phpdoc /en/reference/strings/functions echo.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969369528@lists.php.net to get a copy of this message | ||
sean Tue Aug 9 13:38:33 2005 EDT
Modified files:
/phpdoc/en/reference/strings/functions echo.xml
Log:
echo is not a function; neither is print; print, however, BEHAVES like a function -- #33968
http://cvs.php.net/diff.php/phpdoc/en/reference/strings/functions/echo.xml?r1=1.15&r2=1.16&ty=u
Index: phpdoc/en/reference/strings/functions/echo.xml
diff -u phpdoc/en/reference/strings/functions/echo.xml:1.15
phpdoc/en/reference/strings/functions/echo.xml:1.16
--- phpdoc/en/reference/strings/functions/echo.xml:1.15 Tue Nov 23 04:38:18 2004
+++ phpdoc/en/reference/strings/functions/echo.xml Tue Aug 9 13:38:32 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.15 $ -->
+<!-- $Revision: 1.16 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.echo">
<refnamediv>
@@ -18,9 +18,12 @@
</simpara>
<para>
<function>echo</function> is not actually a function (it is a
- language construct) so you are not required to use parentheses
- with it. In fact, if you want to pass more than one parameter
- to echo, you must not enclose the parameters within parentheses.
+ language construct), so you are not required to use parentheses
+ with it. <function>echo</function> (unlike some other language
+ constructs) does not behave like a function, so it cannot
+ always be used in the context of a function. Additionally, if you want to
+ pass more than one parameter to <function>echo</function>, the parameters
+ must not be enclosed within parentheses.
</para>
<para>
<example>
@@ -67,11 +70,13 @@
line with just a semicolon. no extra whitespace!
END;
-// Because echo is not a function, following code is invalid.
+// Because echo does not behave like a function, following code is invalid.
($some_var) ? echo 'true' : echo 'false';
// However, the following examples will work:
-($some_var) ? print('true'): print('false'); // print is a function
+($some_var) ? print 'true' : print 'false'; // print is also a construct, but
+ // it behaves like a function, so
+ // it may be used in this context.
echo $some_var ? 'true': 'false'; // changing the statement around
?>
]]>