Re: Re: New Feature: Fully qualified class name resolution as scalar with class keyword

From: Date: Tue, 17 Apr 2012 17:23:10 +0000
Subject: Re: Re: New Feature: Fully qualified class name resolution as scalar with class keyword
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 2012-04-17, Stas Malyshev <[email protected]> wrote:
> > May I suggest using foo::__CLASS__ instead of foo::class ? It's longer, but
> > closer to what already exists for this semantic (class name as string),
> > don't you think ?
>
> I like this. __CLASS__ is already being used as class name, and little
> chance of colliding with some code since you're not supposed to be using
> __ prefix in your names.

"class" won't collide anyways, as it's already a keyword, and you can't use
it
in your constant or function names. __CLASS__ has bad connotations for me, as it
resolves to the declaring class normally, not the class invoked.

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc


Thread (41 messages)

« previous php.internals (#60088) next »