Hi,

I do prefer the first style programming after longer time in programming
PHP. I like the idea of keeping HTML and PHP code separate for cosmetic
purpose as well as mantainance. Actually a code with PHP only, I mean really
with NO HTML code in it, is more portable and easy to mantain. As for
performance I don't know, but a difference is present for sure. Actually I
never benchmarked the performance of the two styles, but wanted to give my
10 cents for the coding style :)

Cheers

En3pY


Sebastian Konstanty Zdrojewski 

________________________________

URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]

________________________________

Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 

-----Messaggio originale-----
Da: Anders Norrbring [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 5 dicembre 2005 8.27
A: PHP General
Oggetto: [PHP] Performance question


I've been spending some time to find performance pros and cons, but so far
haven't had any real luck.

Can someone on this list say which is better than the other, and also why,
when it comes to these kinds of syntax:

1.
php code
?>
<html statements><?= $variable ?></end tag> <tag><?= $var2 ?></end tag> <?
more php code

2.
php code
echo "<tag>$variable</end tag>";
echo "<tag>$var2</end tag>";
more php code

In both cases, some processing is done, not that 'echo' uses a lot of cpu
time, but still...
On the other hand, there are more jumps in and out for the interpreter in
the first example...

I'd love some thoughts on this.
-- 

Anders Norrbring
Norrbring Consulting

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 02/12/2005
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to