From: "Anguz" <[EMAIL PROTECTED]>

> So I thought that maybe I could only define the needed ones in each
> case, although there's more in the include file. Example:
>
> if ($in_array('Hello', $functionArray))
> {
> function Hello()
> {
> echo 'Hello';
> }
> }
>
> I understand that the whole php file will be parsed, or does the parser
> skip the whole block inside the if when the condition is not met? But
> even if it is parsed, if the condition is not met, I believe that the
> function won't be defined, so I assume this would at least save RAM or
> something, right? Or not at all?

All your code is still going to be parsed. The only way you're going to
"save" anything is if you have conditional include() calls and only include
external files based upon what you need. For example, instead of loading
functions1.php and functions2.php, just load one or the other based upon
what action is being performed.

If you can't divide your functions up like that, then there's not much you
can save, just include the whole file. The parsing of the include files /
functions is probably going to be minimal compared to the actual execution
of the code, anyhow.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to