Print vs Echo

I been looking to code from a co worker, and saw something. he used way more print instead of echo so this makes me want to research a bit about, here is the result:

When it comes to speed, echo "String"; is a bit more faster than print "String";

But on the other hand, print behave like a function, so we could say something like:
$foo = print "Super foo"; and $foo will be 1. For consequence we can use print as part of a more complex expression. BUT we can also use echo with a true-false statement.
So to conclude. because is faster ;)


Leave a Reply

Your email address will not be published.