Re: variable scoping...
| From: | Michael Virnstein | Date: | Fri, 12 Apr 2002 11:29:53 +0000 |
| Subject: | Re: variable scoping... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92745@lists.php.net to get a copy of this message | ||
why do you have more than one class with the same name?
would be easier using different names for different classes.
or define a base class template
and extend it in the files as desired, but give them unique names.
how do you know later, which class does what in which way, when they have
the same
name. not very good imo.
"Aric Caley" <greywire@peoplecatcher.net> schrieb im Newsbeitrag
news:20020412093739.22177.qmail@pb1.pair.com...
> Is it possible to keep the variable name-space separate between, say, two
> files (one included into the other) to avoid name collisions? I'm trying
to
> get two scripts to work together on the same page. Each script defines
some
> classes that have the same names but work differently (ex., class
Template).
> All I need is to embed the output of one script into the other.
>
> Now, I could do this by just getting the output from a URL but that seems
> really inefficient. Or I could run the script from the CGI version of PHP
> using exec() but that also seems like it could be really slow and clunky.
>
> Is there some efficient way of doing this?
>
> It would be cool if you could just put the include() inside of a function
> and have all the classes and variable names be local inside that function
> but that didnt seem to work... plus the scripts explicitly access global
> variable names.
>
>