Re: speed comparison
| From: | Ernest E Vogelsinger | Date: | Tue, 19 Nov 2002 00:03:59 +0000 |
| Subject: | Re: speed comparison | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124996@lists.php.net to get a copy of this message | ||
As Maxim pointed out a couple of days ago, this is just a matter of
nanosecs, it shouldn't be really noticeable from performance.
The fastest was to display non-PHP output is to escape from PHP and enter
plain HTML, like
$a = 'World';
?>
<H1>Hello <?=$a?>!</h1>
<?php
This is quite ugly to read and write, and it prohibits to separate content
from output. So the next fast way to output would be
echo '<H1>Hello World!</h1>';
Note the single quotes - they are (_very_slightly_) faster than double quotes.
If you need to display variables you must revert to
echo "<H1>Hello $a!</H1>";
to parse the string (note the double quotes here).
I would always prefer to have to buy a faster server and use the second or
third method than having to escape from PHP for any output, for what it's
worth.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/