Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32599 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70529 invoked by uid 1010); 3 Oct 2007 15:17:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70514 invoked from network); 3 Oct 2007 15:17:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2007 15:17:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:45365] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/7D-23468-C92B3074 for ; Wed, 03 Oct 2007 11:17:49 -0400 Received: from dhcp-172-28-204-225.zrh.corp.google.com (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 9EB8A1B3674; Wed, 3 Oct 2007 17:17:45 +0200 (CEST) Date: Wed, 3 Oct 2007 17:17:45 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1269215676.20071003171745@marcus-boerger.de> To: Benjamin Schulz CC: internals Mailing List In-Reply-To: <83C14D8F-4F6A-49C6-BE2E-2B80A722A03C@benjaminschulz.com> References: <470295DA.6090602@php.net> <4702A457.5010005@zend.com> <83C14D8F-4F6A-49C6-BE2E-2B80A722A03C@benjaminschulz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: namespaces: import name conflicts with defined class From: helly@php.net (Marcus Boerger) Hello Benjamin, if your exception is so general that it is called exception you can obviously simply use exception. If your exception is actually doing something than name that something. Meaning the name of the exception class is carrying information already. Thus every exception should be specialized. Now namespaces are a tool to help you structure your code and avoid naming issues. They are not a tool to shorten your names or aid you in typing less. And especially namespaces are not there to overcome any naming limitations or tricking the naming rules. marcus Wednesday, October 3, 2007, 11:19:00 AM, you wrote: > On 02.10.2007, at 22:04, Stanislav Malyshev wrote: >>> >> import ::Exception as Notused; >>> import Foo::Exception; >>> ?> >>> >> >> I wouldn't actually recommend using such code. If you have >> Foo::Exception just use Foo::Exception - it's short enough :) >> > And what if not? "throw App::package::subpackage::Exception" in a > file that has the namespace "App::package::subpackage" is just wrong, > importing the Exception as a different name as well. Importing the > global Exception as something else - i don't even know what to answer > to that ... this problem makes the whole concept just seem broken, is > there even a concept? ;) > regards, > Benjamin Best regards, Marcus