Anthony Steven's WebLog

Ini Blog simple, isinya tentang hidup g yang simple.. yah moga-moga aja gak terlalu simple, tp jangan keribetan juga, pusing.... ya GBU all!

Name:
Location: Jakarta, Indonesia

Thinker

Wednesday, November 01, 2006

PHP print vs echo

Another PHP trick.
Print vs Echo, which one better?
Here it goes:

print vs echo


Even both of these output mechanism are language constructs, if you benchmark the two you will quickly discover that print() is slower then echo(). The reason for that is quite simple, print function will return a status indicating if it was successful or not, while echo simply print the text and nothing more. Since in most cases (haven't seen one yet) this status is not necessary and is almost never used it is pointless and simply adds unnecessary overhead.

Seems, I have to learn a lot, heheh

0 Comments:

Post a Comment

<< Home