Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60087 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21655 invoked from network); 17 Apr 2012 17:07:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2012 17:07:51 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:48978] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/99-03996-563AD8F4 for ; Tue, 17 Apr 2012 13:07:50 -0400 Received: by lahl5 with SMTP id l5so5096458lah.29 for ; Tue, 17 Apr 2012 10:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nWsiSa5BsaBNZm0PB/I1fY/ZihgZUQgTy/Et3Dus/co=; b=xADmOD5LRxeDoTt4oW6KZ/blYjcBx5IH7raM3Yy72ZK10j/u8oOOhBsY6PnV7bzkzH XRvxmb5crc/by+XN8q3RZ4GO/HHrx5F6m8N3rb9X2FKW2x/awO7UFn4g4Xg80EKbi03R RM4FEYWJu2MKFWFOErWwGt+uDm68h8mBiz0P2fLudHMkxZgdnt63+DWyRMpodWyFmCtf CQ1tToM//Hk+nqxt52brVa2u1tML+SC/tYrpAhb75pNX8ZxxyWmNrU8UgFXRnykFr8/J d/xap4i1PxybBIzqLj3xtKUqh94dsH3jPIZZi+KVe+EeCp3Knbp+57jRVH6sXIc0LjN8 9Yng== MIME-Version: 1.0 Received: by 10.152.103.134 with SMTP id fw6mr14780451lab.20.1334682466448; Tue, 17 Apr 2012 10:07:46 -0700 (PDT) Received: by 10.152.127.68 with HTTP; Tue, 17 Apr 2012 10:07:46 -0700 (PDT) In-Reply-To: <4F8DA14F.1030204@sugarcrm.com> References: <4F89D4F1.8070009@ralphschindler.com> <4F8CEB3B.4080702@ralphschindler.com> <4F8DA14F.1030204@sugarcrm.com> Date: Tue, 17 Apr 2012 19:07:46 +0200 Message-ID: To: Stas Malyshev Cc: Nicolas Grekas , Ralph Schindler , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: New Feature: Fully qualified class name resolution as scalar with class keyword From: nikita.ppv@googlemail.com (Nikita Popov) On Tue, Apr 17, 2012 at 6:58 PM, Stas Malyshev 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