#33968 [NEW]: Little error in echo's manual page

From: Date: Tue, 02 Aug 2005 14:19:35 +0000
Subject: #33968 [NEW]: Little error in echo's manual page
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369453@lists.php.net to get a copy of this message
From: colder@php.net Operating system: Irrelevant PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Little error in echo's manual page 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'; ?> ]]> -- Edit bug report at http://bugs.php.net/?id=33968&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33968&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33968&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33968&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33968&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33968&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33968&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33968&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33968&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33968&r=support Expected behavior: http://bugs.php.net/fix.php?id=33968&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33968&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33968&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33968&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33968&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33968&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33968&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33968&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33968&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33968&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33968&r=mysqlcfg

« previous php.doc (#969369453) next »