Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8827 invoked from network); 18 Apr 2012 19:59:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 19:59:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:41692] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/C0-03623-11D1F8F4 for ; Wed, 18 Apr 2012 15:59:14 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp16.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 6F22C405E8; Wed, 18 Apr 2012 15:59:09 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp16.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 3465C40350; Wed, 18 Apr 2012 15:59:09 -0400 (EDT) Message-ID: <4F8F1D0C.2030904@sugarcrm.com> Date: Wed, 18 Apr 2012 12:59:08 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: <4F89D4F1.8070009@ralphschindler.com> <4F8CEB3B.4080702@ralphschindler.com> <4F8DA14F.1030204@sugarcrm.com> <4F8DCAC7.2050302@ralphschindler.com> <4F8DF2B6.4030709@sugarcrm.com> <4F8DFB17.7030509@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: New Feature: Fully qualified class name resolution as scalar with class keyword From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > As already mentioned, There can't be a class constant called "class", > because it is a keyword. (const class = 'Foo' is a syntax error). It looks like class constant. So it should work like one (or, in this case, not work since as you noticed there can not be one). > But yes, I agree that runtime resolution only duplicates existing > behavior, so it isn't really necessary (you could argue thought that > self::class similarly also only replicates the existing __CLASS__). It > would be nice for consistency in my eyes, but I'm good without it too I do not see any "consistency" in creating functionality that is not needed and collides with existing syntax and actually works completely different even though it looks the same. Not much sense to have $foo::bar and $foo::class mean completely different things. foo::bar is static constant expression, so is foo::class, but static::class and $foo::class won't be. It all would be very confusing. I suggest limiting ourselves to constant expressions like foo::class, self::class and parent::class. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227