Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36893 invoked by uid 1010); 21 Aug 2007 04:36:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36878 invoked from network); 21 Aug 2007 04:36:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2007 04:36:05 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:45833] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/00-36574-2BB6AC64 for ; Tue, 21 Aug 2007 00:36:03 -0400 Received: from trainburn-lm-corp-yahoo-com.local (64-73-246-98.static-ip.telepacific.net [64.73.246.98]) (authenticated bits=0) by mail.lerdorf.com (8.14.1/8.14.1/Debian-9) with ESMTP id l7L40vxw026469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 20 Aug 2007 21:00:58 -0700 Message-ID: <46CA6367.9090301@lerdorf.com> Date: Mon, 20 Aug 2007 21:00:39 -0700 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Jani Taskinen CC: david.coallier@nyphp.com, Gregory Beaver , internals Mailing List References: <46C9F217.8040804@chiaraquartet.net> <46C9F50A.7040009@sci.fi> In-Reply-To: <46C9F50A.7040009@sci.fi> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.1/4016/Mon Aug 20 16:40:52 2007 on colo.lerdorf.com X-Virus-Status: Clean Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets From: rasmus@lerdorf.com (Rasmus Lerdorf) Sheez, guys, slow down a tad. Just because he says "no performance penalty" in the description, doesn't make it true. Unless I missed something in the patch, I don't see how I would resolve the symbols at compile-time now which means it has been moved to the executor and in doing so it implies a huge performance penalty. -Rasmus Jani Taskinen wrote: > 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 >>> >> >> >