Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32606 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39972 invoked by uid 1010); 3 Oct 2007 17:13:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39956 invoked from network); 3 Oct 2007 17:13:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2007 17:13:33 -0000 Authentication-Results: pb1.pair.com header.from=mbechler@eenterphace.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mbechler@eenterphace.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain eenterphace.org from 212.227.83.217 cause and error) X-PHP-List-Original-Sender: mbechler@eenterphace.org X-Host-Fingerprint: 212.227.83.217 phoenix.epplehaus.de Linux 2.5 (sometimes 2.4) (4) Received: from [212.227.83.217] ([212.227.83.217:41328] helo=server1.epplehaus.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/25-09129-CBDC3074 for ; Wed, 03 Oct 2007 13:13:33 -0400 Received: from localhost (unknown [127.0.0.1]) by server1.epplehaus.de (Postfix) with ESMTP id 95FFCB80B0 for ; Wed, 3 Oct 2007 17:13:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at epplehaus.de Received: from server1.epplehaus.de ([127.0.0.1]) by localhost (mail.epplehaus.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5HDDxpFia1s for ; Wed, 3 Oct 2007 19:13:28 +0200 (CEST) Received: from [192.168.0.86] (unknown [91.46.248.218]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server1.epplehaus.de (Postfix) with ESMTP id A4D2EB8050 for ; Wed, 3 Oct 2007 19:13:28 +0200 (CEST) Message-ID: <4703CD9B.9010002@eenterphace.org> Date: Wed, 03 Oct 2007 19:12:59 +0200 User-Agent: Thunderbird 2.0.0.6 (X11/20070804) MIME-Version: 1.0 To: internals@lists.php.net References: <470295DA.6090602@php.net> <4702A457.5010005@zend.com> <83C14D8F-4F6A-49C6-BE2E-2B80A722A03C@benjaminschulz.com> <1269215676.20071003171745@marcus-boerger.de> <9332EBE9-AE70-4149-836F-C6E51CA4F791@benjaminschulz.com> In-Reply-To: <9332EBE9-AE70-4149-836F-C6E51CA4F791@benjaminschulz.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: namespaces: import name conflicts with defined class From: mbechler@eenterphace.org (Moritz Bechler) Hi internals, I think you are conentrating on the Exception (and even internal class) examples a bit too much. Take the following example: -------- a.php: -------- b.php: -------- c.php: -------- d.php: -------- Running this example produces a "Fatal error: Import name 'Foo' conflicts with defined class in [...]/d.php on line 4". This problem does not only exist with internal classes (which is bad enough - still remember DateTime?) but also when some non-namespaced code might be used in conjunction. As using namespaces is about preventing naming collisions having to assume that some class "Foo" does not exist while developing the library using namespaces is just inacceptable and makes the namespace implementation pretty useless. And if you start arguing that you should not use import in cases where you don't control the global scope you could pretty much argue not to use it at all and remove it (which makes namespaces some eye-candy for very long class names). best regards Moritz Bechler