Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14313 invoked from network); 15 Nov 2008 18:59:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2008 18:59:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:55392] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/D2-32680-D2C1F194 for ; Sat, 15 Nov 2008 13:59:58 -0500 Received: from [83.228.56.37] (port=1359 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1L1QN8-0001RN-7u for internals@lists.php.net; Sat, 15 Nov 2008 12:59:54 -0600 Message-ID: To: References: <49188698.1050505@grudl.com> <49188BD0.9090100@kukulich.net> <4918A3F8.4070809@chiaraquartet.net> <4919A9BD.2020703@grudl.com> <491DE402.4000600@chiaraquartet.net> <72.BB.07308.119ED194@pb1.pair.com> <491E0297.20108@chiaraquartet.net> <3C719ED4B1154E88ADA3A76835B98809@pc> <491EF84E.5040501@chiaraquartet.net> Date: Sat, 15 Nov 2008 20:59:47 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Re: [PHP-DEV] Re: Namespace resolution rules has been changed? From: sv_forums@fmethod.com ("Stan Vassilev | FM") > Are you aware of __NAMESPACE__? Also, if you are using a lot of > external namespace names, you might consider simply defining constants: > > namespace foo\bar\baz; > const ns = __NAMESPACE__; > > then you can simply do > > use foo\bar\baz; $name = baz\ns; > > I don't see a huge pressing need for nameof since the above is 3 extra > lines of code - total - per NS. > > If this sounds good, I will add an example to the new docs > yet-to-be-committed. > > Greg I'm aware of __NAMESPACE__, and your example is kinda creative, but I think that's a touch too much acrobatics for something that's a basic need :P Consider callbacks, factories, strategies, drivers, adapters, proxies and so on which typically may and do pass class/function names around. I don't know. I'd rather endure the pain and write the string in full every single time than cause extra confusion in my source code :) Regards, Stan Vassilev