Doc #72865 [Asn->Csd]: describe difference to echo (with example ideally)
| From: | cmb@php.net | Date: | Wed, 17 Aug 2016 13:52:19 +0000 |
| Subject: | Doc #72865 [Asn->Csd]: describe difference to echo (with example ideally) | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13828@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72865&edit=1
ID: 72865
Updated by: cmb@php.net
Reported by: flashfee at gmx dot net
Summary: describe difference to echo (with example ideally)
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2016-08-17 13:51:54] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339895
Log: Fix #72865: describe difference to echo (with example ideally)
------------------------------------------------------------------------
[2016-08-17 13:44:23] cmb@php.net
The only relevant difference is that
print accepts only one
argument, while echo accepts a comma separated list of
arguments.
As of PHP 7.0.0 both statements compile to the same opcode, namely
ZEND_ECHO, see <https://3v4l.org/lncp9/vld#output>. Formerly, they
had different opcodes (ZEND_ECHO and ZEND_PRINT), but ZEND_PRINT
forwarded to ZEND_ECHO, which might have made print slightly
slower.
------------------------------------------------------------------------
[2016-08-17 12:48:33] flashfee at gmx dot net
Description:
------------
---
From manual page: http://www.php.net/function.print
---
Both echo and print output a string.
The similiarity and differences should be described.
(syntax, performance, buffering, alias ..???)
I use 'print' when I'm programming in Perl, I use echo when programming in PHP.
Now I learned there is also 'print' in PHP? So can I just forget 'echo' and
always use print? :-)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72865&edit=1