[thelist] managing php include dependencies?

kasimir-k kasimir.k.lists at gmail.com
Wed Apr 11 19:18:26 CDT 2007


Ivo scribeva in 11/04/2007 21:42:
> Seems that the order in which files are specified with
> include_once/require_once does not guarantee parsing order 
...
> I guess PHP doesnt parse a file & its includes sequentially

I think that your guessing isn't quite correct here.

PHP indeed and very much parses any PHP code it encounters in order and 
sequentially. It does not look ahead and postpone any parsing based on 
what is coming, but handles stuff as it comes.

Includes are not hanging in some program space somewhere, and the used 
when needed. Instead, including a PHP file A in another PHP file B is 
exactly the same, if you had written the content of A in the file B in 
the spot where you have the include statement.

.k





More information about the thelist mailing list