Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28910 invoked by uid 1010); 10 Sep 2007 23:21:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28895 invoked from network); 10 Sep 2007 23:21:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2007 23:21:13 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.114 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.114 unknown Windows 2000 SP4, XP SP1 Received: from [63.205.162.114] ([63.205.162.114:56028] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/10-28088-961D5E64 for ; Mon, 10 Sep 2007 19:21:13 -0400 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 10 Sep 2007 16:21:12 -0700 Message-ID: <46E5D163.4050800@zend.com> Date: Mon, 10 Sep 2007 16:21:07 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: 'PHP Internals' Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Sep 2007 23:21:12.0285 (UTC) FILETIME=[46C5A0D0:01C7F401] Subject: multiple namespace per file From: stas@zend.com (Stanislav Malyshev) Hi! Following the feedback from the community, we (mostly me and Dmitry) tried to find a good model that would allow multiple namespaces per file without running into too many problems and complications, and would allow to bundle multiple namespaced files together without modifications. It looks like it is possible to do, but only under the following condition: the file can have multiple namespaces, but if the file has namespaces, then it can have no code outside namespaces. For example, this would work: namespace A; class X {} namespace B; class Y {} This would not work: class X {} namespace A; class Y {} This would not work either: require 'foo/bar.php'; namespace A; class X {} This however would work: namespace A; require 'foo/bar.php'; class X {} namespace B; class Y {} So, for the people that wanted multiple NS per file, would such solution work? P.S. this is *not* a "should we use braces" thread, so please don't :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com