Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32893 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84522 invoked by uid 1010); 20 Oct 2007 23:25:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84506 invoked from network); 20 Oct 2007 23:25:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2007 23:25:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=chuck@horde.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chuck@horde.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain horde.org designates 66.92.78.250 as permitted sender) X-PHP-List-Original-Sender: chuck@horde.org X-Host-Fingerprint: 66.92.78.250 dsl092-078-250.bos1.dsl.speakeasy.net Received: from [66.92.78.250] ([66.92.78.250:58269] helo=technest.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/4D-03598-76E8A174 for ; Sat, 20 Oct 2007 19:25:28 -0400 Received: by technest.org (Postfix, from userid 33) id 69BCD7F00D; Sat, 20 Oct 2007 19:25:25 -0400 (EDT) Received: from tatiana (tatiana [192.168.1.2]) by technest.org (Horde Framework) with HTTP; Sat, 20 Oct 2007 19:25:25 -0400 Message-ID: <20071020192525.74792p4tk62gmc2s@technest.org> Date: Sat, 20 Oct 2007 19:25:25 -0400 To: Stanislav Malyshev 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> <471A8926.8020607@zend.com> In-Reply-To: <471A8926.8020607@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.2-cvs) Subject: Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload From: chuck@horde.org (Chuck Hagenbuch) Quoting Stanislav Malyshev : >> ... which is correct as far as it goes, there are no side effects. =20 >> However, if I flip the include order, including 1.php before 2.php, =20 >> then I get this: >> >> Test::Exception >> Test::Exception > > Of course, since once Test::Exception is defined, Exception in =20 > namespace Test refers to it. It does not influence imports though. > >> namespace I have full control over the things inside my namespace. =20 >> The way things work right now I either need to list every single =20 >> class in my namespace in every file of that namespace - which is =20 >> going to be a bit > > Of course not - the problem even exists only for those classes that =20 > override internal class names, and only in the context where the =20 > overriding class is not defined but you still want to use it. If you =20 > either explicitly load it or specify full name - it would be OK. And =20 > so far we have one such name - Exception, so telling "every single =20 > class" is a gross overstatement unless your package does nothing but =20 > throwing exceptions :) Right, it's not going to affect most classes most of the time, but my =20 point is that you can't predict which classes will be affected. =20 Exception is just the most obvious example. Looking at the built-in =20 class list, Directory and DateTime jump out as ones that will probably =20 come up a lot. Also looking at the global classes list, it's not that big. I really =20 don't think importing your external dependencies would be a hardship. I know Stas gets a lot of weight here because he can write the code =20 for it. I'd like to know if any other developers have strong feelings =20 either way, because I can write tests or even (scary as it might be =20 for others) look at the engine code to change this behavior if that's =20 the only difference maker. -chuck