Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33942 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25290 invoked by uid 1010); 11 Dec 2007 23:12:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 25275 invoked from network); 11 Dec 2007 23:12:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2007 23:12:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:35503] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/C1-11541-E691F574 for ; Tue, 11 Dec 2007 18:12:47 -0500 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id DEE46C0F0FB for ; Tue, 11 Dec 2007 16:12:44 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-15-179.neb.res.rr.com [76.84.15.179]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 9E6F5C0F0F8 for ; Tue, 11 Dec 2007 16:12:44 -0700 (MST) Message-ID: <475F1984.603@chiaraquartet.net> Date: Tue, 11 Dec 2007 17:13:08 -0600 User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: internals Mailing List X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: namespace improvements to be committed very soon - final review From: greg@chiaraquartet.net (Gregory Beaver) Hi, I've been furiously working behind the scenes with Stas and Dmitry, and have some enhancements to namespaces in the form of 2 patches. 1) multiple namespaces per file 2) use ::name; 1) multiple namespaces per file This is implemented as such: The example above shows that imported names are reset at each namespace declaration. There is no prohibition on this code: Users who wish to use brackets may do so. The performance penalty imposed by using brackets is minor for some cases, and for users who are following the recommended practice of 1 namespace per file, the syntax is ideal. Patch is: http://pear.php.net/~greg/namespace/PHP_5_3/multi.patch.txt http://pear.php.net/~greg/namespace/PHP_6_0/multi.patch.txt Note that non-namespaced code cannot be present in a file containing namespaces. For users who are bundling, this will mean you will need to create 2 files, one with non-namespaced code, and one with namespaced code. This minor prohibition is a design decision, not a technical problem in the implementation. 2) use ::name This code: is currently impossible, which will make namespacing old code harder. The patch introduces this new syntax to import names from the global namespace: http://pear.php.net/~greg/namespace/PHP_5_3/use.patch.txt http://pear.php.net/~greg/namespace/PHP_6_0/use.patch.txt These patches are for review of both serious technical and serious implementation issues. In order to help move things along, I'd like to define "serious" as something directly related to the implementation that would cause a failure in PHP's ability to run scripts deterministically, or some kind of memory leak/crash. commit is planned for the next 24 hours or so, but of course any issues found in review can be fixed. The patches are short, so in the worst case, reverting is not difficult. Thanks, Greg