Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33927 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74365 invoked by uid 1010); 11 Dec 2007 18:00:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74349 invoked from network); 11 Dec 2007 18:00:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2007 18:00:36 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:28741] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/70-60949-240DE574 for ; Tue, 11 Dec 2007 13:00:36 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Dec 2007 20:00:30 +0200 Received: from [192.168.16.91] ([192.168.16.91]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Dec 2007 10:00:25 -0800 Message-ID: <475ED038.3080004@zend.com> Date: Tue, 11 Dec 2007 10:00:24 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: =?ISO-8859-1?Q?David_Z=FClke?= CC: Matthias Pigulla , Sam Barrow , internals@lists.php.net References: <11970653983080000@9866357972520000.9866341568840000> <475BDDF1.7040605@ctindustries.net> <1723341090.20071210220025@marcus-boerger.de> <1197323296.3922.5.camel@sbarrow-desktop> <00A2E2156BEE8446A81C8881AE117F199A0715@companyweb> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Dec 2007 18:00:25.0052 (UTC) FILETIME=[B487F1C0:01C83C1F] Subject: Re: AW: [PHP-DEV] Namespace resolution From: stas@zend.com (Stanislav Malyshev) > The problem I see with that is that if I have an application that uses a > 3rd-party library which does not use namespaces, I need to use > ::LibClass everywhere. Until they switch to namespaces - then I need to > touch hundreds and thousands lines of code. If LibClass were looked up > in the global namespace, too, I could simply add the appropriate import > statements at the top of each file. But also it means that namespaced library would be influenced by any use code around, which was exactly the thing we tried to avoid. > Anyways, the process you described seems flawed in another fashion: It > looks up a class in the namespace first, then an internal php class, > then it tries an autoload. That does not make sense. Lets say I run some Actually, it does :) > code as you described, and there is a class C(), but it's not been > autoloaded yet. The internal class C is used. Then, later, the > autoloading of A::B::C() is somehow forced. Now, if the same code runs > again, a different class is used. That sounds like nonsense. Not, it's not nonsense - try to find other way that allows overriding internal class names and doesn't force exhaustive autoload search on each access to internal class - and you'll understand why it makes sense. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com