ID: 46821 Updated by: [EMAIL PROTECTED] Reported By: php at pk dot freesurf dot fr -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: linux PHP Version: 5.2.8 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2008-12-10 12:46:21] php at pk dot freesurf dot fr Description: ------------ include "foo.php" within a loop is re-accessed & re-compile before execution each time... php already knows that the file has been included (include_once generates an error), but does not remember the code within... for source code clarity, has there is no macro-processor like in C, it is very usefull to use the include statement... a function call is not appropriate in every case, as local variable scope can be a problem... if there are 20 or more variable to be accessed, code will be not clear if they are part of function arguments, neither the code will be clear if all variables are declared global. so it is really an issue for me... Reproduce code: --------------- <? for ($i=0;$i<10000;++$i) { include "foo.php"; } ?> foo.php : hundreds of code lines when content of foo.php is pasted inside the loop, execution time dramasticaly shorter.. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46821&edit=1