Req #74362 [Opn->Wfx]: Make echo and print equivalent
| From: | nikic@php.net | Date: | Sun, 02 Apr 2017 13:18:39 +0000 |
| Subject: | Req #74362 [Opn->Wfx]: Make echo and print equivalent | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208284@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74362&edit=1
ID: 74362
Updated by: nikic@php.net
Reported by: olafvdspek at gmail dot com
Summary: Make echo and print equivalent
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: PHP Language Specification
+Package: Scripting Engine problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2017-04-02 13:03:11] dm@php.net
print has a return value along with outputting and can be used as e.g. return
print json_encode(...); while echo can not.
------------------------------------------------------------------------
[2017-04-02 12:45:54] kelunik@php.net
That's not the only difference, the return types also vary. "echo" is
"void" while "print" returns "int".
------------------------------------------------------------------------
[2017-04-02 12:42:39] olafvdspek at gmail dot com
Description:
------------
Could print be made equivalent to echo such that it accepts multiple arguments?
> The only difference to print is that echo accepts an argument list.
> The only difference to echo is that print only accepts a single argument.
http://php.net/echo
http://php.net/print
Test script:
---------------
<?php
echo('A', 2, 'C');
print('A', 2, 'C');
Actual result:
--------------
-
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74362&edit=1