There are plenty of examples of both on the web. The php manual says "The include() statement [...]", which seems contradictory - if it's a statement shouldn't it not have parenthesis?
Both of these work:
include('somefile.php');
include 'somefile.php;
So should I or anyone else care?
Single values within parens evaluate to the value itself, so the parens themselves are of no consequence.
Statements having only one parameter, can have also parenthesis, e.g:
Both. In many areas of the PHP documentation, everything is referred to as a statement. Example (from control structures) - "A statement can be an assignment, a function call, a loop, a conditional statement or even a statement that does nothing (an empty statement)."
The difference between a statement and a functions is a matter of the semantics of the individual language. Thus, it's up the PHP maintainers to either explicitly define this, or let it remain ambiguous.
for echo always use echo "test"
The parentheses are parameters for a function. With
include
you can use it either as a function or a statement in php.Documentation here: http://php.net/manual/en/function.include.php
With
echo
same concept, quoting from the PHP manual hereQuoting from the manual (my emphasis)
These are also called "special forms", and include such things as
echo
andreturn
statements. Note that while none of these are functions, you can still speak of expressions and statements, the difference being the former have a value while the latter don't. Sinceinclude
,include_once
,require
andrequire_once
all return a value (TRUE
if the include was successful), they can be used in expressions. By this reasoning, "include statement" would be incorrect, thoughinclude
s are almost always used as statements.