Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41927 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2969 invoked from network); 15 Nov 2008 17:20:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2008 17:20:15 -0000 X-Host-Fingerprint: 83.6.234.204 abcs204.neoplus.adsl.tpnet.pl Received: from [83.6.234.204] ([83.6.234.204:16648] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/C0-32680-FC40F194 for ; Sat, 15 Nov 2008 12:20:15 -0500 Message-ID: <3F.C0.32680.FC40F194@pb1.pair.com> To: internals@lists.php.net Followup-To: php.internals Lines: 34 Date: Sat, 15 Nov 2008 18:20:09 +0100 References: <49188698.1050505@grudl.com> <49188BD0.9090100@kukulich.net> <4918A3F8.4070809@chiaraquartet.net> <4919A9BD.2020703@grudl.com> <491DE402.4000600@chiaraquartet.net> <491E03BA.4040507@grudl.com> Organization: CrystalPoint User-Agent: KNode/0.99.01 MIME-Version: 1.0 Content-Type: text/plain; charset="" Content-Transfer-Encoding: 8Bit X-Posted-By: 83.6.234.204 Subject: Re: Namespace resolution rules has been changed? From: m.kurzyna@crystalpoint.pl (Marcin Kurzyna) David Grudl wrote: > Why? I have developed framework using PHP namespaces and studied Zend > Framework source codes and result is: if we use the new resolution rules > (1), than in nearly all cases developers must prefix class names with \, > only in few cases prefix is not required. Why? Because usually classes > in more nested namespaces extends classes in less nested namespaces. If > you don't believe, look in framework sources :-) > > So, resolution alá 1) is nearly in all cases pain and in few cases nice, > resolution alá 2) is nearly in all cases nice and in few cases not too > nice. true, however i have a counter example: classes from more general namespace that use further nested classes (think some kind of behaviour and different drivers/plugins for example). so while it's true that more nested classes usually extend the less nested ones it also common for more generic code to use it's namespace descendants. in sutch condition possibility to use just the remaining namespace part is a big help and i'd say it's usage would be more comon than single "extends" at class definition where you're obligated to supply FQN [1]. > > Furthermore, resolution alá 1) means, that namespace named foo\stuff is > fiction - there is only namespace named \foo\stuff. Lets use \foo\stuff > everywhere: i second that (at least when FQN is used) - would provide more consistency. m. [1] FQN: fully quallified name