From bb0af361c5d02139e3e9fdf267d61517e1ae3c54 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Tue, 5 Mar 2002 11:25:00 +0000 Subject: [PATCH] trying to explain some consequences of the differences between language constructs "echo" and "print" git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@71976 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/strings.xml | 11 ++++++++--- language/functions.xml | 11 ++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/functions/strings.xml b/functions/strings.xml index 551300c237..431cda00cd 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -1,5 +1,5 @@ - + String functions Strings @@ -518,6 +518,9 @@ if (crypt($user_input,$password) == $password) { 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 echo in a + variable function + context, but you can use print instead. <function>echo</function> examples @@ -1657,9 +1660,11 @@ echo $second[1]; /* prints "another" */ Outputs arg. &return.success; - print is not actually a function (it is a + print is not actually a real function (it is a language construct) so you are not required to use parentheses - with it. + with it. But print, opposed to + echo, can be called using a + variable function. <function>print</function> examples diff --git a/language/functions.xml b/language/functions.xml index 90e6bfa0a7..548c77cf2c 100644 --- a/language/functions.xml +++ b/language/functions.xml @@ -1,5 +1,5 @@ - + Functions @@ -332,11 +332,12 @@ $newref =& returns_reference(); be used to implement callbacks, function tables, and so forth. - Variable functions won't work with language constructs such as + Variable functions won't work with language constructs other + than print, such as echo, unset, - isset and empty. This is - one of the major differences between PHP functions and language - constructs. + isset and empty. + This is one of the major differences between PHP functions + and languageconstructs.