Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40833 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21549 invoked from network); 2 Oct 2008 02:07:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2008 02:07:21 -0000 X-Host-Fingerprint: 74.163.138.78 adsl-163-138-78.mia.bellsouth.net Received: from [74.163.138.78] ([74.163.138.78:9296] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/12-04812-7DC24E84 for ; Wed, 01 Oct 2008 22:07:19 -0400 To: internals@lists.php.net,Stanislav Malyshev Message-ID: <48E42CD4.8010000@gmail.com> Date: Wed, 01 Oct 2008 22:07:16 -0400 User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 References: <48D7F5EF.3090202@zend.com> In-Reply-To: <48D7F5EF.3090202@zend.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 74.163.138.78 Subject: Re: namespace issues From: jrhernandez05@gmail.com (Jessie Hernandez) Stanislav Malyshev wrote: > Hi! > > On the ZendCon, we (Marcus, Elizabeth, Andi and myself) had a talk about > what we'd like to do with namespaces, and we arrived at the following > conclusions, which we propose to implement in 5.3: > > 1. Allow braces for namespaces. So, the syntax for namespaces will be: > a) namespace foo; > should be first (non-comment) statement in the file, namespace extends > to the end of the file or next namespace declaration. > b) namespace foo {} > can appear anywhere on the top scope (can not be nested). > Mixing both syntaxes in one file is not possible. The semantics of both > syntaxes will be identical. > > 2. Simplify resolution order for classes in the namespace: unqualified > names are resolved this way: > a) check "use" list if the name was defined at "use", follow that > resolution > b) if not, the name resolves to namespace::name > Consequence of this will be that for using internal class inside > namespace one would need to refer to it either as ::Foo or do use ::Foo > prior to its usage. > > 3. Functions will not be allowed inside namespaces. We arrived to > conclusion that they are much more trouble than they're worth, and > summarily we would be better off without them. Most of the functionality > could be easily achieved using static class methods, and the rest may be > emulated with variable function names, etc. > > Comments? Figuring that you arrived at the same conclusion nearly three years ago regarding my namespace patch, and I also agreed that only classes should be allowed inside namespaces (http://marc.info/?l=php-internals&m=113320797607651&w=2), I am +1 for this proposal. -- Jessie Hernandez Zend Certified Engineer (http://zend.com/zce.php?c=ZEND006359&r=222727282)