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

From: Date: Tue, 17 Apr 2012 19:55:51 +0000
Subject: Re: Re: New Feature: Fully qualified class name resolution as scalar with class keyword
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
"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

Thread (41 messages)

« previous php.internals (#60107) next »