Re: Re: Order of class resolution with namespaces and autoload

From: Date: Sat, 20 Oct 2007 21:54:58 +0000
Subject: Re: Re: Order of class resolution with namespaces and autoload
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-32886@lists.php.net to get a copy of this message
Except that it makes it unclear what happens in _other_ files, which is
In other files you specify what happens to other files.
even worse. Once you include the file above, any other file in the Test:: namespace that throws an Exception will throw Test::Exception, not Exception, even if it doesn't import Test::Exception.
I'm afraid I don't understand. Regardless of what you include where, the name resolution for the file is defined by the code and imports in this file. Since that file does not define test::exception, it would not influence resolution of any file it is included in.
I think it makes much more sense to import classes that are _outside_ the current namespace. Having to import pieces of your own namespace makes namespaces less useful and intuitive.
Import is just a way to write names shorter. Thus, you can employ it to achieve different goals. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32886) next »