|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-04 09:17 UTC] sniper@php.net
[2005-08-04 09:17 UTC] sniper@php.net
[2005-08-09 19:39 UTC] sean@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 11:00:01 2025 UTC |
Description: ------------ There is a little error in "Example 1. echo() examples" block. ### // Because echo is not 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 ### The problem is that print is not a function. Its not really a matter of "It doesn't work because its a language construct". Here are the patches en+fr: Index: en/reference/strings/functions/echo.xml =================================================================== RCS file: /repository/phpdoc/en/reference/strings/functions/echo.xml,v retrieving revision 1.15 diff -u -r1.15 echo.xml --- en/reference/strings/functions/echo.xml 23 Nov 2004 09:38:18 -0000 1.15 +++ en/reference/strings/functions/echo.xml 2 Aug 2005 14:10:41 -0000 @@ -67,11 +67,11 @@ 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 behaves like a function echo $some_var ? 'true': 'false'; // changing the statement around ?> ]]> Index: fr/reference/strings/functions/echo.xml =================================================================== RCS file: /repository/phpdoc-fr/reference/strings/functions/echo.xml,v retrieving revision 1.22 diff -u -r1.22 echo.xml --- fr/reference/strings/functions/echo.xml 5 Jul 2005 21:05:27 -0000 1.22 +++ fr/reference/strings/functions/echo.xml 2 Aug 2005 14:13:03 -0000 @@ -73,11 +73,11 @@ de plus ! END; -// comme echo() n'est pas une fonction, le code suivant n'est pas valide -($some_var) ? echo('Oui') : echo('Non'); +// comme echo() ne se comporte pas comme une fonction, le code suivant n'est pas valide +($some_var) ? echo 'Oui' : echo 'Non'; // Cependant, les lignes suivantes sont valides : -($some_var) ? print('Oui') : print('Non'); // print est une fonction +($some_var) ? print 'Oui' : print 'Non'; // print se comporte comme une fonction. echo $some_var ? 'Oui' : 'Non'; ?> ]]>