Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40519 invoked from network); 2 Dec 2008 21:25:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2008 21:25:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=david@grudl.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=david@grudl.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain grudl.com from 74.125.78.26 cause and error) X-PHP-List-Original-Sender: david@grudl.com X-Host-Fingerprint: 74.125.78.26 ey-out-2122.google.com Received: from [74.125.78.26] ([74.125.78.26:1723] helo=ey-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/70-36301-1D7A5394 for ; Tue, 02 Dec 2008 16:25:38 -0500 Received: by ey-out-2122.google.com with SMTP id 5so1222948eyj.59 for ; Tue, 02 Dec 2008 13:25:34 -0800 (PST) Received: by 10.210.16.10 with SMTP id 10mr14542706ebp.48.1228253133830; Tue, 02 Dec 2008 13:25:33 -0800 (PST) Received: from ?192.168.1.23? ([77.240.188.66]) by mx.google.com with ESMTPS id x26sm7085148ugc.9.2008.12.02.13.25.31 (version=SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 13:25:32 -0800 (PST) Message-ID: <4935A7AF.7010405@grudl.com> Date: Tue, 02 Dec 2008 22:25:03 +0100 User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: PHP internals Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: New namespace implementation From: david@grudl.com (David Grudl) I just read the new namespace documentation and I must say that the new implementation is much more flexible. Great work! I had only two objections: 1) False warnings As http://php.net/manual/en/language.namespaces.importing.php says, it is possible to import non-compound name. // importing a global class use ArrayObject; but it generates Warning: The use statement with non-compound name 'ArrayObject' has no effect. 2) Relative Resolving I pointed out to inappropriate relative resolving earlier (http://news.php.net/php.internals/41837). In the world of well-written namespaced frameworks the ratio of usage of "more nested" classes vs. "less nested" is in large majority in favor of the second (http://news.php.net/php.internals/41980), but PHP prefer the first way. Now, the new implementation offers way to resolve names relative when it is needed - using 'namespace' operator (as equivalent of the 'self' operator). So I think now there is no reason to use default relative resolving and it should be removed. What about voting? David Grudl