|
Posted by Richard Lynch on 01/07/05 18:44
> Just out of curiosity, a lot of people had answers to this question, but
> I couldn't find a shred of evidence in the
> documentation. Did you do similar tests, hear from gurus, or something
> of like? Or did I just miss it somewhere?
Once upon a time, a long time ago, require and include were different.
In fact, they were different in exactly the way being discussed, only more
so.
'require' would be loaded *ONCE* when the script got there, and the values
within the file required would be whatever they were upon that first load.
'include' would be "re-loaded" each time it was reached.
This cause all manner of confusion, and somewhere around version 3 or 4,
was abandoned.
The only difference now is that require signals an ERROR and include only
a WARNING.
In either case, if your require/include is inside a conditional, it will
NOT be "seen" by PHP until that line of code is executed.
This is the way 'include' worked, and the way most people who were
confused in earlier versions though 'require' "should" have worked. Now
it does.
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|