note 43501 modified in function.echo by iridium
| From: | iridium@php.net | Date: | Thu, 24 Jun 2004 11:55:12 +0000 |
| Subject: | note 43501 modified in function.echo by iridium | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71587@lists.php.net to get a copy of this message | ||
As an addition to <dannydannydanny at tranceaddict dot net>'s post:
There is a reason that echo is faster than print; print is a FUNCTION, implemented as a PHP
extention, and loaded via Zend API, who need to parse argument, pass them to the C function, which
does the output operation, etc...
echo is a "language construct", that means that PHP core parses it and does the output
operation alone, without any help of Zend API, that's why you can use it without parenthesis
(echo "test\n";), etc...
That's a thing to remember when you write a script that does a lot of printing operation, you
can save a lot of CPU time.
Editors note:
The amount of time really is negligible. A 0.0035052299499512 time difference for 50,000 calls
really is nothing. Very few (if any) scripts need be concerned about this.
--was--
As an addition to <dannydannydanny at tranceaddict dot net>'s post:
There is a reason that echo is faster than print; print is a FUNCTION, implemented as a PHP
extention, and loaded via Zend API, who need to parse argument, pass them to the C function, which
does the output operation, etc...
echo is a "language construct", that means that PHP core parses it and does the output
operation alone, without any help of Zend API, that's why you can use it without parenthesis
(echo "test\n";), etc...
That's a thing to remember when you write a script that does a lot of printing operation, you
can save a lot of CPU time.
Editors note:
The amount of time really is negligible. A 0.0035052299499512 time difference for 50,000 calls
really is nothing. Very few scripts need be concerned about this.
http://php.net/manual/en/function.echo.php