-
Bug
-
Resolution: Deferred
-
Minor
-
None
-
3.2.5, 3.3
-
None
-
2.7
-
Easy
-
MOODLE_32_STABLE, MOODLE_33_STABLE
-
master
The codechecker plugin contains a sniff (IncludingFileSniff.php) that enforces the inclusion of redundant parenthesis around the path to be included.
e.g. "require_once" must be immediately followed by an open parenthesis
There is a common misconception about the nature of include, require, include_once, and require_once.
None of these language constructs require parenthesis, and it can be argued that enforcing this behaviour as a matter of course is bad practice.
_PHP manual - see examples #4 and #5 http://php.net/manual/en/function.include.php_
"Because include is a special language construct, parentheses are not needed around its argument. Take care when comparing return value."
_Pear coding standards - http://pear.php.net/manual/en/standards.including.php_
"include_once and require_once are statements, not functions. Parentheses should not surround the subject filename."
It is for a similar reason echo and print do not require the use of parenthesis (and their use can potentially break normal use of echo).
Note: List of PHP keywords http://php.net/manual/en/reserved.keywords.php