... which is correct as far as it goes, there are no side effects. However, if I flip the include order, including 1.php before 2.php, then I get this:

Test::Exception
Test::Exception

Of course, since once Test::Exception is defined, Exception in namespace Test refers to it. It does not influence imports though.

namespace I have full control over the things inside my namespace. The way things work right now I either need to list every single class in my namespace in every file of that namespace - which is going to be a bit

Of course not - the problem even exists only for those classes that override internal class names, and only in the context where the overriding class is not defined but you still want to use it. If you either explicitly load it or specify full name - it would be OK. And so far we have one such name - Exception, so telling "every single class" is a gross overstatement unless your package does nothing but throwing exceptions :)

The main thing is that I think that the sort of people who are going to want to use namespaces are going to want namespaces to be as self-contained as possible, and that means explicitly importing external bits, not internal bits.

You can not be entirely self-contained as you are going to rely heavily on internal classes and functions anyway.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to