Is the block of code of an included file ‘grabbed’ when the calling script first starts or when the include statement is reached? Take for example:
// execute many lines of code
sleep(10);
// do file retrievals that takes many minutes
include('somefile.php');
If the original code is executed (commenced), is the code block of somefile.php put in memory at that instant or not until the include statement is reached?
When the include statement is executed/run.
PHP is executed line by line. So, when the process arrives at the
include, it will do its magic.For example:
See http://php.net/manual/en/function.include.php