Re: Re: New Feature: Fully qualified class name resolution as scalar with class keyword
| From: | Matthew Weier O'Phinney | 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 internals+get-60088@lists.php.net to get a copy of this message | ||
On 2012-04-17, Stas Malyshev <smalyshev@sugarcrm.com> 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 | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc