Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40609 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64325 invoked from network); 22 Sep 2008 20:16:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2008 20:16:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:58504] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/A4-42380-73DF7D84 for ; Mon, 22 Sep 2008 16:16:56 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Sep 2008 23:16:57 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Sep 2008 12:46:06 -0700 Message-ID: <48D7F5EF.3090202@zend.com> Date: Mon, 22 Sep 2008 12:45:51 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: 'PHP Internals' Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Sep 2008 19:46:06.0888 (UTC) FILETIME=[DAB3D280:01C91CEB] Subject: namespace issues From: stas@zend.com (Stanislav Malyshev) 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? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com