PHP behavior of include/require inside conditional

lillianmaroon

New Member
If I place an \[code\]include\[/code\] or \[code\]require\[/code\] statement inside a conditional that evaluates to \[code\]false\[/code\], will the PHP interpreter skip the include file altogether, or will it load it just in case?An example would be:\[code\]if ($some_user_var) { require 'this.php';} else { //do stuff}\[/code\]I read somewhere that \[code\]require\[/code\] will always be included by the interpreter regardless of the conditional, but \[code\]include\[/code\] will not. If that's the case, just switching from \[code\]require\[/code\] to \[code\]include\[/code\] 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.
 
Back
Top