Peter Thoenen wrote:

>Question on optimizing code for quicker runtimes. 
>Which is quicker (this is on a webpage also..NOT
><?php if ($a){ echo 'abc'; } ?>
><?php if ($a) { ?> abc <?php } ?>

Because the difference is going to be undetectable, this would probably 
be a question that only someone really familiar with the engine would be 
able to answer with any sort of assurance.

My bet is that the second method is faster in theory, because switching 
in/out of PHP is likely marginally faster than executing the echo 
function. Maybe if you create some scripts that loop through these 
statements 10,000 times each and measure the time with microtime(), you 
can get a more affirmative answer and let the list know your results.

Happy hacking.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to