Hmmm - I am not convinced that this is happening... however, I don't have 4.0.2 or lower installed anywhere at present, and I can't be bothered to go about it....
Anyhow - follow this....
how can a file be included even if that code block is not executed. As far as I recall (many apologies if I am wrong) but include(..) is not a pre-processor directive, therefore should not actually be executed until it gets to that line. BUT, if PHP never goes to that line, then the file should never be included. Take this example:
$strFilename = 'no_file';
if (false)
{
// Unless something very screwy is going on PHP will NEVER get here and therefore no code should get executed
$strFilename = 'test.inc.php';
include($strFilename);
}
else
{
// But it will get here
}
print($strFilename);
In the above code PHP will never get to "$strFilename = 'test.inc.php';" and so, $strFilename will never be set to the correct value, and no file will be included. If it tried to, the include would fail and produce a PHP warning. Warning's only appear on the 2nd pass of the PHP (code execution - the 1st pass would be parsing the file), this therefore proves (in a convoluted way) that "include" is not a pre-processor directive, and so is only executed when that line is reached.
Anyhow - I am going a slightly long winded way about describing this - but it's the end of a long weeked so I apologise!
In summary - I cannot test this because I don't have the time or the inclanation to install an old version of PHP. However, if you are convinced it is happening, then place the include filename into a variable and call include with that variable. If this manages to include the file (as you suggest it would), then I would be totally shocked, since the pre-processor and syntactic check will not look at variable values since the code is not being executed.
In short - I don't think you have a problem....but try the above if you are convinced you do 🙂