|
Posted by Richard Lynch on 01/07/05 19:56
Jamie Alessio wrote:
> BUT, also from documentation on http://us2.php.net/include/ it looks
> like your example might not hold any water either. "Be warned that parse
> error in required file doesn't cause processing halting." Based on that
> it appears that introducing the parse error in foo2.php doesn't prove
> that the file wasn't included. So, how do we actually prove this one way
> or the other? I guess we could just like at the underlying C code. Any
> takers?
I think the warning you quote is, in fact, trying to say this:
"Be warned that a parse error in an included/required fill will not halt
processing until that file is included/required."
In other words, just because your script loads once with no parse errors,
doesn't mean it always will if external conditions change which files get
included/required within that script.
My thesis is that the quote implies the answer to the original question.
After doing this for most of a decade, I'm gonna tell you:
The include/require files do *NOT* get loaded until PHP encounters the
line that includes/requires them!
Here's a dog-simple test.
Take a *BIG* text file. I mean *BIG*. Like, War & Peace big. No, no,
like, Dictionary Of English *BIG*. The biggest text file you can find.
Now do something like this:
#!/usr/local/bin/php -q
<?php
if (isset($argv[1])){
require 'monster_text_file.txt';
}
echo "Hi\n";
?>
Now run that script like:
../foo.php 1 > /dev/null
../foo.php > /dev/null
If you really think PHP can *read* the file that fast, I want to know your
hard drive make&model. :-)
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|