hholzgra Tue Mar 5 06:25:00 2002 EDT Modified files: /phpdoc/en/language functions.xml /phpdoc/en/functions strings.xml Log: trying to explain some consequences of the differences between language constructs "echo" and "print" Index: phpdoc/en/language/functions.xml diff -u phpdoc/en/language/functions.xml:1.24 phpdoc/en/language/functions.xml:1.25 --- phpdoc/en/language/functions.xml:1.24 Mon Jan 21 04:25:23 2002 +++ phpdoc/en/language/functions.xml Tue Mar 5 06:24:59 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.24 $ --> +<!-- $Revision: 1.25 $ --> <chapter id="functions"> <title>Functions</title> @@ -332,11 +332,12 @@ be used to implement callbacks, function tables, and so forth. </para> <para> - Variable functions won't work with language constructs such as + Variable functions won't work with language constructs other + than <function>print</function>, such as <function>echo</function>, <function>unset</function>, - <function>isset</function> and <function>empty</function>. This is - one of the major differences between PHP functions and language - constructs. + <function>isset</function> and <function>empty</function>. + This is one of the major differences between PHP functions + and languageconstructs. </para> <para> <example> Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.164 phpdoc/en/functions/strings.xml:1.165 --- phpdoc/en/functions/strings.xml:1.164 Wed Feb 27 17:09:11 2002 +++ phpdoc/en/functions/strings.xml Tue Mar 5 06:25:00 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.164 $ --> +<!-- $Revision: 1.165 $ --> <reference id="ref.strings"> <title>String functions</title> <titleabbrev>Strings</titleabbrev> @@ -518,6 +518,9 @@ 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. + It is not possible to use <function>echo</function> in a + <link linkend="functions.variable-functions">variable function</link> + context, but you can use <function>print</function> instead. <example> <title><function>echo</function> examples</title> <programlisting role="php"> @@ -1657,9 +1660,11 @@ Outputs <parameter>arg</parameter>. &return.success; </simpara> <para> - <function>print</function> is not actually a function (it is a + <function>print</function> is not actually a real function (it is a language construct) so you are not required to use parentheses - with it. + with it. But <function>print</function>, opposed to + <function>echo</function>, can be called using a + <link linkend="functions.variable-functions">variable function</link>. </para> <example> <title><function>print</function> examples</title>