|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-10 15:19 UTC] jani@php.net
[2008-12-15 19:19 UTC] php at pk dot freesurf dot fr
[2008-12-15 21:32 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
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..