Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32925 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10212 invoked by uid 1010); 23 Oct 2007 03:55:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10197 invoked from network); 23 Oct 2007 03:55:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2007 03:55:36 -0000 Authentication-Results: pb1.pair.com header.from=chuck@horde.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=chuck@horde.org; spf=pass; 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:41345] helo=technest.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/F2-21656-5B07D174 for ; Mon, 22 Oct 2007 23:55:36 -0400 Received: by technest.org (Postfix, from userid 33) id 77C257F00D; Mon, 22 Oct 2007 23:55:30 -0400 (EDT) Received: from tatiana (tatiana [192.168.1.2]) by technest.org (Horde Framework) with HTTP; Mon, 22 Oct 2007 23:55:30 -0400 Message-ID: <20071022235530.82912k3mlfz2ajsw@technest.org> Date: Mon, 22 Oct 2007 23:55:30 -0400 To: Stanislav Malyshev Cc: internals@lists.php.net, greg@chiaraquartet.net References: <20071019224202.20245u5zry52h5c8@technest.org> <471A6B32.3080401@zend.com> <20071020172658.1680416b83wxgv6s@technest.org> <471A7C88.6090904@zend.com> <20071020184554.69044keujpgfelus@technest.org> <471A8A12.3050407@zend.com> <20071020191948.19935z9hoqcn9c84@technest.org> <471A9049.1020408@zend.com> <20071020194217.98794nbyt3bwrlnk@technest.org> <471AEF26.5000601@zend.com> <20071021105124.85283gxiqqx9zse8@technest.org> <471BA74C.1040103@zend.com> <20071021203755.11105vn0ycds6bs4@technest.org> <471D4623.4090208@zend.com> In-Reply-To: <471D4623.4090208@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] Order of class resolution with namespaces and autoload From: chuck@horde.org (Chuck Hagenbuch) Quoting Stanislav Malyshev : >> import Exception; >> -> name conflict, which seems correct > > import Exception is a no-op, so I don't understand how you could =20 > have got name conflict. Do you mean "import Test::Exception"? That =20 > should work, if it didn't it's a bug. It turns out that this does not happen with CVS PHP 5.3. With Greg's =20 first patch for fixing multiple uses of import Test::Exception, =20 however, this is the reproduce script and error: > import Exception as Error; >> -> Fatal error: Import name 'Error' conflicts with defined class in =20 >> /Users/chuck/Desktop/php namespaces/2.php on line 4 >> (this I don't understand) > > I'm afraid I am missing something since in line 4 of 2.php there's =20 > no definition of any class or import. Can you give me full examples =20 > of non-working parts? It might be there's some bug in there. This is another one that only happens with Greg's initial patch (I =20 haven't tried the next one yet Greg, sorry). For Greg's benefit here's =20 the reproduce script: > import ::Exception as Error; >> -> parse error (can't import a top-level class name that way) > > Well, we might allow importing global classes, if it's needed. I think this would be a good thing. >> Therefore, in my mind, in order to write durable code that will not =20 >> break no matter what other classes other developers define or =20 >> import, I should always prefix builtin classes with ::. > > Other developers shouldn't define or import classes into your namespace... I think you need to envision working in a large team on a large =20 project here, but you may simply not see the need. -chuck