Re: Singletons
2014-02-05 Marco Pivetta <[email protected]>:
> On 5 February 2014 11:19, Kevin Ingwersen <[email protected]>
> wrote:
>
> > Hello. ^^
> >
> > I just wanted to ask, if there is a singleton implementation? The current
> > one is rather "hackish", by using a static property, initializer and a
> > function to itneract with it all. Sadly, I can not put a patch together
> > myself - because I am not good with YACC and Flex yet, or with the php
> vm -
> > but i would have a concept for an implementation o.o
> >
>
> Hi Kevin,
>
> I don't think that standardizing a well known anti-pattern in core is a
> good idea.
> The current static property approach is quite fine and safe to use (if you
> really need it, which is "no" in 99.9999% of cases), and not hackish at
> all.
>
Beside this: Thats how it works in all me known languages. I don't know any
language, where a pattern (in any form) is part of the core.
>
> Cheers,
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/
>
--
github.com/KingCrunch
Thread (13 messages)