RE: [PHP-DEV] [PATCH] Late Static Binding
| From: | Dmitry Stogov | Date: | Fri, 03 Mar 2006 07:57:13 +0000 |
| Subject: | RE: [PHP-DEV] [PATCH] Late Static Binding | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-22097@lists.php.net to get a copy of this message | ||
I can agree with "class", but it cannot be reused in other places:
owner::foo()
get_owner_class()
__OWNER_CLASS__
Thanks. Dmitry.
> -----Original Message-----
> From: Marcus Boerger [mailto:helly@php.net]
> Sent: Thursday, March 02, 2006 10:52 PM
> To: Jeff Moore
> Cc: mlively@ft11.com; Lukas Smith; Derick Rethans; Dmitry
> Stogov; Andi Gutmans; 'PHP-DEV'; 'Marcus Boerger'
> Subject: Re: [PHP-DEV] [PATCH] Late Static Binding
>
>
> Hello Jeff,
>
> Thursday, March 2, 2006, 8:21:08 PM, you wrote:
>
> > On Mar 2, 2006, at 11:33 AM, Mike Lively wrote:
>
> > Hi Mike,
>
> >> In regards to naming: 'static' wasn't my first choice
> either. In fact
> >> I was originally using 'this::' due to me misreading the
> notes from
> >> the PDM.
>
> > Does 'this' work ok? I like that one. this:: and $this
> would both be
> > late binding one for the class the other for the instance.
> It makes a
> > lot of sense to me. I think it explains why self isn't
> late binding,
> > too. very nice.
>
> > this::method()
> > this::$property
> > this::constant
> > get_this_class()
>
> >> (I doubt very strongly that anyone 'relies' on early binding for
> >> static functions...I could be wrong though.)
>
> > But they do for static properties. Changing the meaning of
> > self::$property would probably break some stuff.
>
> Please no change of behavior and please not for the sake of
> wording make things slower by cahing to do more slow string
> comparisons at runtime becuase that is what self requires.
> Instead i like reusing already existing keywords whose
> meaning would be easy understandable. That said and after
> declining 'static' we are left with the following:
>
> class::functionName()
>
> Which is pretty good to me.
>
> Best regards,
> Marcus
>
>
>