Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32890 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79491 invoked by uid 1010); 20 Oct 2007 23:03:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79475 invoked from network); 20 Oct 2007 23:03:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2007 23:03:09 -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:36149] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/4C-03598-B298A174 for ; Sat, 20 Oct 2007 19:03:08 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 21 Oct 2007 01:03:05 +0200 Received: from [192.168.17.1] ([192.168.17.1]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Sat, 20 Oct 2007 16:03:01 -0700 Message-ID: <471A8926.8020607@zend.com> Date: Sat, 20 Oct 2007 16:03:02 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Chuck Hagenbuch CC: Gregory Beaver , internals@lists.php.net References: <20071019224202.20245u5zry52h5c8@technest.org> <47196F1A.80400@chiaraquartet.net> <471A6BC6.3090608@zend.com> <20071020172832.338919lgcfp4v1us@technest.org> <471A7932.9040707@zend.com> <20071020182434.512034p03a24phes@technest.org> In-Reply-To: <20071020182434.512034p03a24phes@technest.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Oct 2007 23:03:01.0553 (UTC) FILETIME=[5D2B2210:01C8136D] Subject: Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload From: stas@zend.com (Stanislav Malyshev) > ... which is correct as far as it goes, there are no side effects. > However, if I flip the include order, including 1.php before 2.php, then > I get this: > > Test::Exception > Test::Exception Of course, since once Test::Exception is defined, Exception in namespace Test refers to it. It does not influence imports though. > namespace I have full control over the things inside my namespace. The > way things work right now I either need to list every single class in my > namespace in every file of that namespace - which is going to be a bit Of course not - the problem even exists only for those classes that override internal class names, and only in the context where the overriding class is not defined but you still want to use it. If you either explicitly load it or specify full name - it would be OK. And so far we have one such name - Exception, so telling "every single class" is a gross overstatement unless your package does nothing but throwing exceptions :) > The main thing is that I think that the sort of people who are going to > want to use namespaces are going to want namespaces to be as > self-contained as possible, and that means explicitly importing external > bits, not internal bits. You can not be entirely self-contained as you are going to rely heavily on internal classes and functions anyway. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com