Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32604 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10228 invoked by uid 1010); 3 Oct 2007 16:19:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10213 invoked from network); 3 Oct 2007 16:19:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2007 16:19:18 -0000 Authentication-Results: pb1.pair.com header.from=php@benjaminschulz.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@benjaminschulz.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain benjaminschulz.com from 80.81.249.139 cause and error) X-PHP-List-Original-Sender: php@benjaminschulz.com X-Host-Fingerprint: 80.81.249.139 mx.systisoft.com Linux 2.5 (sometimes 2.4) (4) Received: from [80.81.249.139] ([80.81.249.139:34464] helo=mx.systisoft.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/00-09129-301C3074 for ; Wed, 03 Oct 2007 12:19:16 -0400 Received: (qmail 11429 invoked from network); 3 Oct 2007 16:19:05 -0000 Received: from unknown (HELO mail.ih.systisoft.com) (217.13.198.186) by mx.systisoft.com with SMTP; 3 Oct 2007 16:19:05 -0000 Received: from localhost (localhost [127.0.0.1]) by mail.ih.systisoft.com (Postfix) with ESMTP id 48794347159 for ; Wed, 3 Oct 2007 18:19:09 +0200 (CEST) Received: from mail.ih.systisoft.com ([127.0.0.1]) by localhost (heidi.b.ih.systisoft.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16680-08 for ; Wed, 3 Oct 2007 18:19:04 +0200 (CEST) Received: from [10.0.3.10] (marvin.b.ih.systisoft.com [10.0.3.10]) by mail.ih.systisoft.com (Postfix) with ESMTP id 6C242347138 for ; Wed, 3 Oct 2007 18:19:04 +0200 (CEST) In-Reply-To: <1269215676.20071003171745@marcus-boerger.de> References: <470295DA.6090602@php.net> <4702A457.5010005@zend.com> <83C14D8F-4F6A-49C6-BE2E-2B80A722A03C@benjaminschulz.com> <1269215676.20071003171745@marcus-boerger.de> Mime-Version: 1.0 (Apple Message framework v752.3) X-Priority: 3 (Normal) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <9332EBE9-AE70-4149-836F-C6E51CA4F791@benjaminschulz.com> Content-Transfer-Encoding: 7bit Date: Wed, 3 Oct 2007 18:19:01 +0200 To: internals Mailing List X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: by amavisd-new at mail.ih.systisoft.com X-Spam-Status: No, hits=-2.638 tagged_above=-999 required=5 tests=ALL_TRUSTED, BAYES_00, MISSING_SUBJECT, NO_RECEIVED X-Spam-Level: Subject: Re: [PHP-DEV] Re: namespaces: import name conflicts with defined class From: php@benjaminschulz.com (Benjamin Schulz) > > The exception example is well an exception. Here you must inherit > exception. > That is simply how PHP works, it is an intended limitation. That > said in > this case you should not use Exception for your own stuff. Name it > after > your library or product, like MyProductException. > Hey, i have an idea, why not use namespaces and call it MyProduct::Exception and name everything MyProduct::* - this way i won't get in conflict with global classes, oh wait ... > Right, you might want to have a class DOM because DOM means something > different for your company. > Yep, that's why i call it Company::DomDocument, and hey, everyone with a different namespace can import it in his file as "DomDocument", right? That sounds very comfortable to me. *sigh* > Generally you should do all your stuff in a namespace and do not > import > anything into the global namespace. > You know that import works per File, right? There is no risk that one accidently tries to catch a MyProduct::Exception if he consciously used "import MyProduct::Exception;" in his file. regards, Benjamin