On Tue, Apr 17, 2012 at 6:58 PM, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> Hi!
>
>> 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.
>From the collisions point of view `class` and `__CLASS__` are equally
safe. They both are lexer keywords, so it's not possible to declare
constants with them as name.

Imho ClassName::class reads nicer and also looks similar to the
similar ClassName.class syntax in Java.

Nikita

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to