Re: Re: Using Static Class Variables to Access Globally
| From: | Nathan Nobbe | Date: | Wed, 24 Sep 2008 15:31:13 +0000 |
| Subject: | Re: Re: Using Static Class Variables to Access Globally | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280849@lists.php.net to get a copy of this message | ||
On Wed, Sep 24, 2008 at 6:28 AM, Richard Heyes <richard@php.net> wrote:
> > /me prefers singleton with __get and __set but each to their own :)
>
> Do you mean registry?
could be, but it doesnt have to. when i think of a registry, i think of
something that stores a single instance of several classes in a structure
like an array, and then when asked by clients for an instance of a certain
class, it either gives them a handle to the object it has internally or
creates it first (if not yet created) then returns the handle. earlier in
this thread we were talking about using the singleton as a way to have
'custom superglobals' essentially, which imo, is different than a registry.
-nathan