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

From: Date: Tue, 17 Apr 2012 22:46:14 +0000
Subject: Re: Re: New Feature: Fully qualified class name resolution as scalar with class keyword
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-60124@lists.php.net to get a copy of this message
Hi! > 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. But that's exactly what Foo::class is - completely static constant. > 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. In the same vein you could say class statements affect __CLASS__ :). They are both compile-time constants. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#60124) next »