Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32589 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22688 invoked by uid 1010); 3 Oct 2007 13:57:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22672 invoked from network); 3 Oct 2007 13:57:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2007 13:57:28 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:33620] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/D4-23468-5CF93074 for ; Wed, 03 Oct 2007 09:57:27 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id A96B4C0E1C6; Wed, 3 Oct 2007 06:57:22 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-5-144.neb.res.rr.com [76.84.5.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id E1920C0E1C4; Wed, 3 Oct 2007 06:57:21 -0700 (MST) Message-ID: <4703A08D.3010606@chiaraquartet.net> Date: Wed, 03 Oct 2007 09:00:45 -0500 User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: Benjamin Schulz CC: internals Mailing List References: <470295DA.6090602@php.net> <4702A457.5010005@zend.com> <83C14D8F-4F6A-49C6-BE2E-2B80A722A03C@benjaminschulz.com> In-Reply-To: <83C14D8F-4F6A-49C6-BE2E-2B80A722A03C@benjaminschulz.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] Re: namespaces: import name conflicts with defined class From: greg@chiaraquartet.net (Gregory Beaver) Benjamin Schulz 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 The above code works just fine. Yes there is a concept. import is best used within a namespace. So, namespace your code and there is no need to import global classes. Greg