Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38772 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97317 invoked from network); 4 Jul 2008 18:15:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2008 18:15:11 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 76.96.62.56 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 76.96.62.56 qmta06.westchester.pa.mail.comcast.net Received: from [76.96.62.56] ([76.96.62.56:54558] helo=QMTA06.westchester.pa.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/30-29804-DA86E684 for ; Fri, 04 Jul 2008 14:15:09 -0400 Received: from OMTA01.westchester.pa.mail.comcast.net ([76.96.62.11]) by QMTA06.westchester.pa.mail.comcast.net with comcast id luEf1Z0020EZKEL5600700; Fri, 04 Jul 2008 18:15:06 +0000 Received: from earth.ufp ([24.13.255.226]) by OMTA01.westchester.pa.mail.comcast.net with comcast id luF61Z0084trKQ83MuF68e; Fri, 04 Jul 2008 18:15:06 +0000 X-Authority-Analysis: v=1.0 c=1 a=yUklgHTPdgYA:10 a=2ohliWUCjLYA:10 a=hlHVYoyC57g-eE5BtkYA:9 a=HWykp24H0HU7iwBiRmAA:7 a=XBwTcVy667xCKjWC2unjS6reGrgA:4 a=FHBbIDN7CdwA:10 a=LY0hPdMaydYA:10 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id 31E40D8786 for ; Fri, 4 Jul 2008 13:15:06 -0500 (CDT) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FpbzO8mNf2nS for ; Fri, 4 Jul 2008 13:15:06 -0500 (CDT) Received: from luna.local (unknown [192.168.42.104]) by earth.ufp (Postfix) with ESMTP id 0C06FD874F for ; Fri, 4 Jul 2008 13:15:06 -0500 (CDT) To: internals@lists.php.net Date: Fri, 4 Jul 2008 13:15:04 -0500 User-Agent: KMail/1.9.9 References: <1215076043.7021.10.camel@localhost> <1215172604.32294.34.camel@goldfinger.johannes.nop> <1215174704.8875.32.camel@localhost> In-Reply-To: <1215174704.8875.32.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200807041315.05006.larry@garfieldtech.com> Subject: Re: [PHP-DEV] [RFC] Namespaces for internal classes From: larry@garfieldtech.com (Larry Garfield) On Friday 04 July 2008 7:31:44 am Lars Strojny wrote: > Hi Johannes, > Alright, that's what my RFC was aiming for. Maybe from the wrong > direction. I wanted to do it exemplary for SPL and go on further for all > the other extensions we bundle in core. Namespacing everything is the > only way to reliably avoid collisions as the other option would be to > prefix anything except core. But what if we move an extension out of > core, should it be prefixed than? > > cu, Lars If I may... =46rom a userland perspective, the potential pitfall I see with namespacing= PHP=20 core stuff is that namespaces allow you to completely rename something. If= =20 you have to "use" something in order to use it, the odds are quite good of= =20 different people using different aliased names, even if they don't need to.= =20 I have worked with people who I am certain would do the following just to b= e=20 difficult (or because they don't actually realize what a bad idea the=20 following is): use Spl::Lists::Queue as MyFancyArray; $f =3D new MyFancyArray(); =2E.. Naturally you can't prevent that for namespaced code without removing alias= es,=20 which is not an option, so some of that is going to happen anyway. But it= =20 would really really suck if I have to keep track of what PHP core/SPL class= es=20 or functions are in use in a given script not just by name but also by what= =20 this particular developer decided to alias them to because he was feeling=20 lazy on a particular Friday last year. Doing that for userspace code will = be=20 challenging enough. :-) =2D-=20 Larry Garfield larry@garfieldtech.com