Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41758 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73064 invoked from network); 7 Nov 2008 13:56:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2008 13:56:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=et@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=et@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 62.75.137.136 as permitted sender) X-PHP-List-Original-Sender: et@php.net X-Host-Fingerprint: 62.75.137.136 static-ip-62-75-137-136.inaddr.intergenia.de Linux 2.5 (sometimes 2.4) (4) Received: from [62.75.137.136] ([62.75.137.136:43184] helo=eve.fuer-et.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/7E-02726-BF844194 for ; Fri, 07 Nov 2008 08:56:12 -0500 Received: from lapalma.mis.informatik.tu-darmstadt.de (lapalma.mis.informatik.tu-darmstadt.de [130.83.165.195]) by eve.fuer-et.de (Postfix) with ESMTP id 591C5367AC4E for ; Fri, 7 Nov 2008 14:56:09 +0100 (CET) To: internals@lists.php.net Date: Fri, 7 Nov 2008 14:56:08 +0100 User-Agent: KMail/1.9.7 References: <4EA88C3A8A2747989925A5D21448FCE7@pc> <1226042871.4679.23.camel@goldfinger.johannes.nop> <4914470F.9020307@gmail.com> In-Reply-To: <4914470F.9020307@gmail.com> X-PGP-Key-URL: http://www.mis.informatik.tu-darmstadt.de/People/walk/ MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200811071456.08432.et@php.net> Subject: Re: [PHP-DEV] Call it: allow reserved words in a class or not? From: et@php.net (Stefan Walk) On Friday 07 November 2008 14:47:59 Josh Thompson wrote: > Johannes Schl=FCter wrote: > > On Thu, 2008-11-06 at 22:19 -0600, Josh Thompson wrote: > >> I don't understand why in the namespaced example no one seems to have a > >> problem with new A() meaning new \foo\bar\A(), but we can't use the * > >> wildcard to do the same thing? > > > > Since we don't reliable know all possible classes, think about > > _-autoloading classes, which means we'd have to do more work during > > execution, which can be a slowdown. > > > > johannes > > But we don't reliably know all possible classes in the namespace > example, where we can be autoloading the classes. In the wildcard > example we (c/w)ould already be autoloading the classes anyway, but > instead of sending the class names (A and B) we would send it the > namespace class names first (foo\bar\A and foo\bar\B) and then if that > failed try without the namespace. If one of the classes (B for example) > is in the global namespace, then the developer can simply prefix it with > a (\B) to save on one autoload call. > > I still don't see the fundamental difference between the namespace and > wildcard example. "using" wildcards is considered bad practice in about any language I know, = i=20 wonder why people are so anxious to get it into PHP ... anyways, one=20 fundamental difference is that while you can be only in one namespace, you= =20 can "use" from many. Regards, Stefan