nitpicking : print vs echo

2004 June 20 at 09:13 » Tagged as :

Nit picking can't possibly get worse than arguing over the merits and demerits of echo vs print in PHP. Other favourite topics of these nit pickers include single quotes vs double quotes and multiple if /else if/ else vs switch case.

One guy had done an experiment on this topic (at and his conclusion is that echo is faster by a whopping 4%

That whopping 4% may as well be a statistical error, remember this is not an analytical chemistry lab. If you get your result with in 5% accuracy with in a application stress test you should be happy.

Anyway if you think 4% is 4% go ahead and spend a few minutes changing all your printS to echoS. The time you spend on that effort will pay back when your php script has been accessed about one million times. That's because the 4% difference in this particular experiment amounts to all of 3 milli seconds.

You would be better off spending a few minutes improving your algorithms and .