Re: namespaces: import name conflicts with defined class

From: Date: Wed, 03 Oct 2007 15:10:33 +0000
Subject: Re: namespaces: import name conflicts with defined class
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32597@lists.php.net to get a copy of this message
Hello Benjamin, naive question: how do you define your exception which needs to onherit Exception? Are you doing this: class Exception extends ::exception { } ??? marcus p.s.: I think that is really ugly and actually sounds like replacing a core functionality... Tuesday, October 2, 2007, 1:56:04 PM, you wrote: > Hi all, > import Foo::Bar AS DomDocument; > import Foo::Exception; > import MyStuff::Dom::XsltProcessor; > Result in a "Fatal error: Import name '...' conflicts with defined > class" > 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?). > It's not that one accidentally puts an "import Foo::Exception" in his > file .. > Is there a good reason for this bevhaviour that i don't see? There is > still ::Exception to access the class in the global namespace. > regards, > Benjamin Best regards, Marcus

« previous php.internals (#32597) next »