Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32569 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59303 invoked by uid 1010); 2 Oct 2007 20:14:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59287 invoked from network); 2 Oct 2007 20:14:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2007 20:14:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=markus@fischer.name; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=markus@fischer.name; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fischer.name from 213.46.255.22 cause and error) X-PHP-List-Original-Sender: markus@fischer.name X-Host-Fingerprint: 213.46.255.22 viefep18-int.chello.at Solaris 10 (beta) Received: from [213.46.255.22] ([213.46.255.22:55807] helo=viefep19-int.chello.at) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/91-49174-F86A2074 for ; Tue, 02 Oct 2007 16:14:08 -0400 Received: from genuine.home ([213.47.89.232]) by viefep19-int.chello.at (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20071002201404.URFG21799.viefep19-int.chello.at@genuine.home>; Tue, 2 Oct 2007 22:14:04 +0200 Received: from chello213047089232.17.14.vie.surfer.at ([213.47.89.232] helo=[192.168.1.51]) by genuine.home with esmtpa (Exim 4.50) id 1Ico3S-0004in-Bx; Tue, 02 Oct 2007 22:09:21 +0200 Message-ID: <4702A699.9080702@fischer.name> Date: Tue, 02 Oct 2007 22:14:17 +0200 User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Greg Beaver CC: Benjamin Schulz , internals@lists.php.net References: <470295DA.6090602@php.net> In-Reply-To: <470295DA.6090602@php.net> X-Enigmail-Version: 0.95.3 OpenPGP: id=C2272BD0; url=http://markus.fischer.name/my_public_key.txt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -27 X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "genuine.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Greg Beaver wrote: > Benjamin Schulz wrote: >> Of course i want to refer to my own exception in my application or >> framework as "Exception", and of course i want to use it without >> prefixes (import myStuff::Exception AS MyStuffException), i wouldn't use >> namespace otherwise (there is no other benefit, right?). > > If you are aliasing a class to the same name as an existing class, you > should also import that class with another name: > > import ::Exception as Notused; > import Foo::Exception; > ?> > > This is somewhat unintuitive, but is pretty simple to solve. [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -3.3 ALL_TRUSTED Did not pass through any untrusted hosts -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 2.0 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address [213.47.89.232 listed in dnsbl.sorbs.net] 1.1 AWL AWL: From: address is in the auto white-list Subject: Re: [PHP-DEV] Re: namespaces: import name conflicts with defined class From: markus@fischer.name (Markus Fischer) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Greg Beaver wrote: > Benjamin Schulz wrote: >> Of course i want to refer to my own exception in my application or >> framework as "Exception", and of course i want to use it without >> prefixes (import myStuff::Exception AS MyStuffException), i wouldn't use >> namespace otherwise (there is no other benefit, right?). > > If you are aliasing a class to the same name as an existing class, you > should also import that class with another name: > > import ::Exception as Notused; > import Foo::Exception; > ?> > > This is somewhat unintuitive, but is pretty simple to solve. But how to know in advance, e.g. think about other libraries, which public classes possibly exist? Isn't this problematic then? - - Markus -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHAqaZ1nS0RcInK9ARAorCAJ9BzOIgcJLqAjK6Oycuy2BLA5YHVQCgn/T/ 06+XdBwY4HSJ6aXJzZU1Sh8= =MRLP -----END PGP SIGNATURE-----