If I place an include
or require
statement inside a conditional that evaluates to false
, will the PHP interpreter skip the include file altogether, or will it load it just in case?
An example would be:
if ($some_user_var) {
require 'this.php';
} else {
//do stuff
}
I read somewhere that require
will always be included by the interpreter regardless of the conditional, but include
will not. If that's the case, just switching from require
to include
could mean a free speedup due to the reduced I/O and parsing overhead.
It probably makes a difference if I'm running a preprocessor like eAccelerator, but let's assume I don't.