RE: [PHP] On large application organization [long and possibly boring]
| From: | Richard Lynch | Date: | Fri, 07 Jan 2005 16:44:50 +0000 |
| Subject: | RE: [PHP] On large application organization [long and possibly boring] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205835@lists.php.net to get a copy of this message | ||
> 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