Re: include and include_once functions
| From: | Ignacio Vazquez-Abrams | Date: | Thu, 16 Nov 2000 23:10:30 +0000 |
| Subject: | Re: include and include_once functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25817@lists.php.net to get a copy of this message | ||
On Thu, 16 Nov 2000, Chris McKeever wrote:
> I am wondering about performance logisitics here:
>
> is it bad, not appropriate, not recommended (ETC.) to include a file within
> a function? (note all my included files are just function listings, no code
> outside of functions) when you think about what happens (in a logitcal "this
> goes here way"), this builds nasty embedded code within functions. However,
> PHP may do something with includes, and it doesnt actually appear right
> where it is included.
>
> Am I making any sense?
>
>
Expect to receive a lot of responses. Everyone seems to have their own
idea about this :)
Generally I avoid doing that because there could be scope problems, if not
now then possibly in the future. I include() (or require_once(), as the
case may be) all my stuff at the top, and then call the functions within
as necessary.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>