|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-02-08 02:35 UTC] teo8976 at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/function.echo --- This: """ Description void echo ( string $arg1 [, string $... ] ) """ is in contraddiction with this: """ Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses. """ The second is true, so the first must be corrected. It should read something like: """ Description void echo ( string $arg1) void echo string $arg1 [, string $... ] """ And by the way, why on earth not changing the behavior so that it does accept parenthesis with more than one parameter?? Test script: --------------- --- From manual page: http://www.php.net/function.echo --- This: """ Description void echo ( string $arg1 [, string $... ] ) """ is in contraddiction with this: """ Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses. """ The second is true, so the first must be corrected. It should read something like: """ Description void echo ( string $arg1) void echo string $arg1 [, string $... ] """ And by the way, why on earth not changing the behavior so that it does accept parenthesis with more than one parameter?? Expected result: ---------------- --- From manual page: http://www.php.net/function.echo --- This: """ Description void echo ( string $arg1 [, string $... ] ) """ is in contraddiction with this: """ Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses. """ The second is true, so the first must be corrected. It should read something like: """ Description void echo ( string $arg1) void echo string $arg1 [, string $... ] """ And by the way, why on earth not changing the behavior so that it does accept parenthesis with more than one parameter?? Actual result: -------------- --- From manual page: http://www.php.net/function.echo --- This: """ Description void echo ( string $arg1 [, string $... ] ) """ is in contraddiction with this: """ Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses. """ The second is true, so the first must be corrected. It should read something like: """ Description void echo ( string $arg1) void echo string $arg1 [, string $... ] """ And by the way, why on earth not changing the behavior so that it does accept parenthesis with more than one parameter?? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
The area of the page in question is the function description or "prototype". Its purpose is to describe the prototype of a function (in this case, echo() is a language construct but we document it in the same manner): the function prototype is not meant to be valid PHP code nor a demonstration of how to use the function. Other examples of invalid "PHP code" used in the function prototype include the leading return type declaration ("void") and the square brackets around optional arguments. More details of the different parts of a function prototype, as we display them in the documentation, are available on our "How to read a function definition (prototype)" page at http://php.net/manual/en/about.prototypes.php Finally, yes, the examples section and the textual description section could both make it more clear that parentheses are allowed for single arguments and not allowed for multiple arguments.