Re: speed comparison
| From: | Jeff Bluemel | Date: | Tue, 19 Nov 2002 00:37:33 +0000 |
| Subject: | Re: speed comparison | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125004@lists.php.net to get a copy of this message | ||
I have not problem displaying variable - I do it all over my webpage, or how
to handle them. you may want to check out my post above that has a weblink
to the project, and a better explanation of exactly what I am doing.
"Ernest E Vogelsinger" <ernest@vogelsinger.at> wrote in message
news:5.1.1.6.2.20021119005820.00b4ae48@mail.vogelsinger.at...
> 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/
>