diff --git a/reference/strings/functions/echo.xml b/reference/strings/functions/echo.xml index 3f8e003f8c..ae6f9d7705 100644 --- a/reference/strings/functions/echo.xml +++ b/reference/strings/functions/echo.xml @@ -1,5 +1,5 @@ - + @@ -18,9 +18,12 @@ echo 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. echo (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 echo, the parameters + must not be enclosed within parentheses. @@ -67,11 +70,13 @@ that the here document terminator must appear on a 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 ?> ]]>