Assumably, if includes were processed before the script was executed, it would show a syntax error in foo2.php. We ran
Good point about the syntax error.
the test (v 4.2.1) and no error was returned, so that pretty much answers the question (READ: includes are not processed until they are called). 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?
Testing. In my case I was testing for user-defined classes rather than parser errors (because PHP would have to parse an include'd or require'd file in order to have the definition), but your example is probably better than my own. Nice.
-- Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html PHP Manual: http://php.net/manual/ php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php