Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86390 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15586 invoked from network); 26 May 2015 15:52:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2015 15:52:24 -0000 Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.214.177 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.214.177 mail-ob0-f177.google.com Received: from [209.85.214.177] ([209.85.214.177:33309] helo=mail-ob0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/E0-05273-8B694655 for ; Tue, 26 May 2015 11:52:24 -0400 Received: by obbnx5 with SMTP id nx5so77729059obb.0 for ; Tue, 26 May 2015 08:52:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=nD4ATEl/sURGW6HMLbYYW8G7JzCVkdd9r6ea+XxVAUA=; b=d8mtw4l0gw54pjwxQlYEiU6kwJHHmfnOQpy9p4xn4my7xhl6nJX9LSPtfd8/lY0KWU AdU9tqMv245UQGpb6V/7N3mM272Bx0QNYcDFSy+u2KHKFD4bACO0Ip+oH3bhsU2wd22h QjSSvq2g1Mi8tIEAhGTJ2bNO5i5f0YQCEjdSDgFy8FKNGcalaybBtJCkk349y9NGz9sQ 5MAJn5cpIfJToBmFtXiRmI12HccKEz7ET8aBKI+e2qpc6p2u4pYsndI482IFACB1xPvY zFvxkZSKnj0xdByvFRmrfDVxIelObaD5DLWNC7qVZA1XspzA2uYfD9IztHmqsPl4+IzB KilQ== X-Gm-Message-State: ALoCoQkTjp1XVucfLmaGVWcdnS+DHyoWYCYZEhqawzN2kXaorqGmFGNns9rSBQQiFExdXIr3dqC5 X-Received: by 10.182.199.34 with SMTP id jh2mr22486357obc.48.1432655540665; Tue, 26 May 2015 08:52:20 -0700 (PDT) Received: from [172.16.1.6] (ip72-211-83-231.no.no.cox.net. [72.211.83.231]) by mx.google.com with ESMTPSA id my16sm9193193obc.25.2015.05.26.08.52.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 08:52:20 -0700 (PDT) Message-ID: <556496B3.1030905@ralphschindler.com> Date: Tue, 26 May 2015 10:52:19 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: internals@lists.php.net References: <55636034.6010003@mabe.berlin> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] ::class wrong case From: ralph@ralphschindler.com (Ralph Schindler) > > namespace foo; > > function bar(){} > > var_dump(bar::class); // string(7) "foo\bar" > > ?> > > This was not explained in the RFC at all, and had I known this I would > have voted against it personally. How would you suggest it be different, if not a "compile-time name expansion for classes"? On a personal note, I've gotten plenty of benefit from the feature which (again, for me) totally eclipses the only very small regret that ::class looks like a class constant lookup. That syntactical point could have gone either way, but I feel like the accepted syntax is still a good choice. Your example above might attempt to cause some mis-direction to the reader of the code a bit because you have clearly defined a symbol (function) called "bar", yet you're still name-expanding a class called "bar", which technically could be living in the same namespace in a different file covered by an autoloader. bar::class still does actually mean foo\bar the class, not the function.