Bug #74363 [Nab]: echo doesn't accept multiple arguments
[email protected] ("olafvdspek at gmail dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=74363&edit=1 ID: 74363 User updated by: olafvdspek at gmail dot com Reported by: olafvdspek at gmail dot com Summary: echo doesn't accept multiple arguments Status: Not a bug Type: Bug Package: *General Issues Operating System: Debian PHP Version: 5.6.30 Block user comment: N Private report: N New Comment: @nikic, OK, perhaps the correct syntax could be used right below http://php.net/manual/en/function.echo.php#refsect1-function.echo-description then? Previous Comments: ------------------------------------------------------------------------ [2017-04-02 13:22:19] [email protected] Echo and parenthesis have nothing to do with each other. You can write echo("Foo") in the same way you're allowed to write echo(((((((((("Foo")))))))))). Both are equally pointless. The correct echo syntax is `echo "Foo"`. ------------------------------------------------------------------------ [2017-04-02 13:18:03] olafvdspek at gmail dot com Could it be reclassified as feature request to allow echo to also accept multiple arguments when parentheses are used? If not, IMO the documentation should be improved as explained in the previous comment. ------------------------------------------------------------------------ [2017-04-02 13:01:38] [email protected] Not a bug, explained in manual as you've later realized. ------------------------------------------------------------------------ [2017-04-02 12:53:22] olafvdspek at gmail dot com Grr, this seems to simple to be true. > Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses. > void echo ( string $arg1 [, string $... ] ) Perhaps this should be split into two lines, one without parentheses and with multiple arguments and one with parentheses and a single argument. Or multiple arguments should be supported in both forms.. ------------------------------------------------------------------------ [2017-04-02 12:49:30] olafvdspek at gmail dot com Description: ------------ Echo doesn't appear to accept multiple arguments PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 08:50:21) PHP 7.0.16-3 (cli) (built: Feb 22 2017 10:03:06) ( NTS ) Test script: --------------- <?php echo('A', 'B'); Expected result: ---------------- AB Actual result: -------------- PHP Parse error: syntax error, unexpected ',' in /root/a.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74363&edit=1