Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41046 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82066 invoked from network); 15 Oct 2008 07:04:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2008 07:04:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.94.239.7 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.7 mail.jdi-ict.nl Linux 2.6 Received: from [82.94.239.7] ([82.94.239.7:49491] helo=mail.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/82-25867-A0695F84 for ; Wed, 15 Oct 2008 03:04:44 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id m9F74cah007563; Wed, 15 Oct 2008 09:04:38 +0200 Date: Wed, 15 Oct 2008 09:04:38 +0200 (CEST) X-X-Sender: derick@kossu.ez.no To: Lukas Kahwe Smith cc: PHP Development In-Reply-To: <3CF765DF-27AF-44FD-9ECF-BEBFC8A0AFCA@pooteeweet.org> Message-ID: References: <3CF765DF-27AF-44FD-9ECF-BEBFC8A0AFCA@pooteeweet.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Subject: Re: [PHP-DEV] namespaces and alpha3 From: derick@php.net (Derick Rethans) On Fri, 10 Oct 2008, Lukas Kahwe Smith wrote: > At this point I guess we have the choice between: > > 1) rip them out > 2) status quo > 3) Stas proposal > 4) Dmitrys proposal > > Again I hope that Stas/Dmitry will give us an insight about their proposals, > though Stas proposal might or might not see any changes. Stas wrote up an RFC about the two proposals: http://wiki.php.net/rfc/namespaceref Now I finally figured out what the two things are without having to real a gazillion pointless posts it makes it easier to formulate my point of view. It seems that we're not quite 100% how we want to do things. Reading the "Namespaces with functions/constants" part of Stas' RFC makes me cringe... just changing the behavior of -> and :: to just make things work is a cludge, and a bad one at that. The other part, "Namespaces without functions/constants" is a much more practical solution. However, a third one might be to use a syntax separator that we've not seen at all yet (I'd say ':::'). Even with the "No functions/constants" option I've issues, because of the resolving of internal classes. In a namespace using "new className" they would resolve to nameSpace::className. Having to use ::className to get to an internal class is yet another cludge. IMO the internal classes should be able to use with the "::" and should have precedence over namespace'd classes with the same name. If you really want to re-use an internal class name, use "namespace::className". I realize that that means you need to have at least two "elements" of the namespace'd class while using them. However, while reading code it makes it absolutely clear whether you're using an internal class or not. As we're getting really close to 5.3, I would suggest to remove namespaces from this release as we're simply not done with even agreeing on how things should work. PHP 5.3 has many other cool things, and leaving namespaces for PHP 6 means we're actually introducing functionality there as well (for the folks that don't care about Unicode). We've done with namespaces for a loooong time, and they've never really been *required*. Many people won't be able to use it any way as they have to support older PHP versions in their code base as well. PHP 6 is a much more natural switch for something like this. If we *absolutely *have* to* have namespaces, then we should go with the "Namespaces without functions/constants" proposal, with some tweaks. However, I still think it's not ready enough to put even that into 5.3. regards, Derick -- HEAD before 5_3!: http://tinyurl.com/6d2esb http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org