Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40480 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76540 invoked from network); 12 Sep 2008 04:46:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2008 04:46:55 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 208.83.222.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 208.83.222.18 unknown Linux 2.6 Received: from [208.83.222.18] ([208.83.222.18:44154] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/04-49770-E34F9C84 for ; Fri, 12 Sep 2008 00:46:55 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id E9CB2C0E3DA; Thu, 11 Sep 2008 21:46:05 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 99F6BC0E3D9; Thu, 11 Sep 2008 21:46:05 -0700 (MST) Message-ID: <48C9F44B.7020008@chiaraquartet.net> Date: Thu, 11 Sep 2008 23:47:07 -0500 User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Stan Vassilev | FM CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: Scoping of "use" statements and a strategy for 5.3/6.0 release of namespace From: greg@chiaraquartet.net (Gregory Beaver) Hi Stan, I realized I missed 2 of your points, response below: Stan Vassilev | FM wrote: > Hi, > > Multiple namespaces per file were introduced to allow certain > workflows in PEAR and frameworks like Symphony which can combine > multiple classes and namespaces in a single package. > > They work like this: > > > namespace X; > > ... > > namespace Y; > > ... > > > The problem is, no one thought of scoping "use" statements, so now > those merged files share their "use" imports, thus breaking all the > code where collisions occur. > > Also we have the problems with name resolution of internal vs user > classes and autoloaders, discussed here. I just posted a patch that solves this problem, and a few minutes ago forwarded two messages that further clarify how the patch works and why it is a good solution to the problem. > And we also have the non-intuitive differentiation between resolving > functions/classes/constant which will most likely lead people to > believe functions/constants aren't supported in any way in namespaces > (if they try, and it doesn't work, they won't try second time). The other 2 patches I have posted solve these issues decisively. Since these would change namespace edge cases and introduce a new way to import, I think an alpha3 is warranted. The name resolution changes should not affect any existing working code that utilizes namespaces, but should make it possible to do autoload without having to "use" every single namespace class. The patches do need review, and I am certain the patch introducing function::blah::here() could be better written, and needs a Sara/Dmitry type to take a quick look and say what could be done to improve it. However, I don't think these facts warrant removal of the key feature of namespaces, especially since they are relatively easy to solve - these patches did not take many hours to whip up, and do not change very much. Thanks, Greg