Contents: echo vs. print in PHP

Speed of echo vs print in PHP

The speed of both echo and print statements in PHP is roughly the same. Using one over the other is not likely to yield any performance improvement in your application. Theoretically, echo is more efficient because it does not return any value.

Function vs Language Construct

Unlike most PHP string functions, echo and print aren't functions but language constructs. Therefore it is not required to use parentheses when using echo or print.

Parameters and syntax of print vs echo

When used with parentheses (like a function call), both print and echo take only 1 argument. For example,

echo("Don't panic!");
print("The answer is 42.");

However, when used without parentheses, echo can take several arguments. For example,