-
-
Notifications
You must be signed in to change notification settings - Fork 509
Closed
Milestone
Description
There doesn't appear to be any checks if files are included as:
include '/path/to/file.php';
or
include ( '/path/to/file.php' );
(Repeat for include_once
, require
, require_once
.)
WordPress Core apparently does a mixture of both.
Generally, there is no different between them, except when a comparison is done against it - see Example 4 on http://us1.php.net/manual/en/function.include.php. Otherwise, the (
)
are redundant and can be safely removed.
There is a PEAR sniff that could be used / adapted from.
This was mentioned in the #core-coding-standards channel, so while any addition would go into WordPress-Extras
right now, it may be that the Handbook has been updated, so this could go into WordPress-Core
standard instead.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
Select code repository
Activity
johnbillion commentedon Jun 30, 2017
Not including parentheses is actually faster because PHP treats it as the language construct instead of a function. Definitely falls under micro-optimisation though.
Extra
toCore
#2097