|
Posted by Hans van Kranenburg on 05/13/05 03:24
chotiwallah wrote:
> suppose i have the following code:
>
> switch ($inc):
> case 0:
> require 'inc0.php';
> break;
> case 1:
> require 'inc1.php';
> break;
> case 2:
> require 'inc2.php';
> break;
> endswitch;
This doesn't exactly look like php...
> question: does php actually include and parse all 3 files, or just
> the one needed (isuppose so, but i'm not sure)? how does that
> influence performance (each inc is about 40k)?
Just read the documentation:
http://nl.php.net/manual/en/function.require.php
Note: Prior to PHP 4.0.2, the following applies: require() will always
attempt to read the target file, even if the line it's on never
executes. The conditional statement won't affect require(). However, if
the line on which the require() occurs is not executed, neither will any
of the code in the target file be executed. Similarly, looping
structures do not affect the behaviour of require(). Although the code
contained in the target file is still subject to the loop, the require()
itself happens only once.
--
"He who asks a question is a fool for five minutes;
he who does not ask a question remains a fool forever"
Navigation:
[Reply to this message]
|