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
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