Peter Thoenen wrote:

>Question on optimizing code for quicker runtimes. 
>Which is quicker (this is on a webpage also..NOT
>commandline)?
>
><?php if ($a){ echo 'abc'; } ?>
>
>OR
>
><?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.

Chris


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

Reply via email to