jacoblukewood jacoblukewood - 5 months ago 7
PHP Question

PHP echo correct input syntax

I can't seem to find a straight up answer on this…
Lets say I want to echo "Stack Overflow FTW" to the screen. Should I use

echo ('Stack Overflow FTW');


or

echo 'Stack Overflow FTW';


If it doesn't really matter, which one would be the best one to get into the habit of using?

Answer

echo isn't actually a function in PHP, it's a language construct. This means that parentheses are not required and as such I would recommend not using them as they just add clutter.