Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40709 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18587 invoked from network); 26 Sep 2008 19:25:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2008 19:25:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=Johannes.Schlueter@Sun.COM; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 192.18.6.21 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 192.18.6.21 gmp-eb-inf-1.sun.com Solaris 10 (beta) Received: from [192.18.6.21] ([192.18.6.21:36158] helo=gmp-eb-inf-1.sun.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/BF-63390-E173DD84 for ; Fri, 26 Sep 2008 15:25:19 -0400 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10]) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m8QJPB5F019261 for ; Fri, 26 Sep 2008 19:25:15 GMT Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K7T00001HUGCT00@fe-emea-10.sun.com> (original mail from johannes@php.net) for internals@lists.php.net; Fri, 26 Sep 2008 20:25:11 +0100 (BST) Received: from [192.168.1.101] ([88.217.15.23]) by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K7T00I6IHXUX820@fe-emea-10.sun.com>; Fri, 26 Sep 2008 20:25:09 +0100 (BST) Date: Fri, 26 Sep 2008 21:24:44 +0200 In-reply-to: <48D7F5EF.3090202@zend.com> Sender: Johannes.Schlueter@Sun.COM To: Stanislav Malyshev Cc: "'PHP Internals'" Message-ID: <1222457084.16613.83.camel@goldfinger.johannes.nop> MIME-version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-type: text/plain Content-transfer-encoding: 7BIT References: <48D7F5EF.3090202@zend.com> Subject: Re: [PHP-DEV] namespace issues From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Mon, 2008-09-22 at 12:45 -0700, Stanislav Malyshev wrote: > 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. I'm fine with that, personally I'd like having only the {}-Syntax but as many people want both, well, ... For future times (6.0) we might think about adding nesting support - if we get it working good with the engine, but no show-stopper, we're "delayed" enough... > 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. That will hurt a bit when working with DOM for example, but still +1. > 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. That's fine, I'm not sure about constants, neither one way nor the other, but in general I see some support for dropping them. johannes