Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86251 invoked by uid 1010); 20 Aug 2007 20:09:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86235 invoked from network); 20 Aug 2007 20:09:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2007 20:09:36 -0000 Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.171 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.171 outbound.mailhop.org FreeBSD 4.6-4.9 Received: from [63.208.196.171] ([63.208.196.171:4791] helo=outbound.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/02-06760-005F9C64 for ; Mon, 20 Aug 2007 16:09:36 -0400 Received: from cs136054.pp.htv.fi ([213.243.136.54] helo=[192.168.1.100]) by outbound.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1INDZ7-000AxQ-S2; Mon, 20 Aug 2007 16:09:34 -0400 X-MHO-User: U2FsdGVkX1/HTmW8FC7qA7VNSCRO+iRxY/dce4szd4c= X-MHO-User: U2FsdGVkX1+azo5jys+MsJ9M1l5G4KhwMwKpK3qb8yk= X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 213.243.136.54 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18+5zJVw1w6lF6+8lfBTigAUwtK55bGBQs= Message-ID: <46C9F50A.7040009@sci.fi> Date: Mon, 20 Aug 2007 23:09:46 +0300 Reply-To: Jani Taskinen User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: david.coallier@nyphp.com CC: Gregory Beaver , internals Mailing List References: <46C9F217.8040804@chiaraquartet.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets From: jani.taskinen@sci.fi (Jani Taskinen) This is the wrong way to do things around here. If you want something in, just commit and ignore the noise on this list. --Jani david.coallier@nyphp.com kirjoitti: > Thanks. someone please commit that as fast as posible so no one can say anything > > ;-) > > On 8/20/07, Gregory Beaver wrote: >> Hi all, >> >> This patch is also available at >> http://pear.php.net/~greg/namespace.patch.txt >> >> The patch adds the syntax "namespace { *stuff }" and allows multiple >> namespaces per file with no performance penalty or added complexity as >> only 4 lines of code need to be changed, and 9 lines of code added to >> implement this support! >> >> Basically, there is one use case of multiple namespaces per file that >> the patch is designed to support, which is the ability to cram many >> files into a single file. I have done this for purposes of distributing >> things (prior to phar), it is used by some with phing tasks for >> performance reasons, and can have other uses as well. >> >> The patch provides the ability to do this, for example: >> >> > namespace One { >> require_once 'blah.php'; >> class MyClass extends blah >> { >> function test() >> { >> echo "OK\n"; >> } >> } >> function test() >> { >> echo "OK\n"; >> } >> } >> >> namespace Two { >> class MyClass >> { >> function test() >> { >> echo "OK\n"; >> } >> } >> function test() >> { >> echo "OK\n"; >> } >> } >> ?> >> >> Note that the old format "namespace OneRingToRuleThemAll;" is still >> fully supported, and should be the recommended format, as build tools >> can easily take an entire file, change namespace .*; into namespace .*{ >> and append to the end of the file. >> >> The attached patch is against php6, but as you can see, a blind monkey >> could port it to PHP_5_3 when the time comes. All of the introduced >> changes are now tested, including the error message for nested namespace >> declarations, and the error message for multiple namespace declarations >> with ; (which was previously untested by .phpt tests) >> >> Thanks, >> Greg >> > >