"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.

I tend to agree. __CLASS__ to me belongs to the family of constants like __DIR__ and __FILE__ where they are meant to be evaluated in-place and are simply a substitution for something completely static.

In my mind, while Foo::class returns a scalar, it is subject to resolution by use statements generally at the top of a file or namespace declaration and is computed based on what namespace it is in and what use statements affect it.

-ralph


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

Reply via email to