Re: Order of class resolution with namespaces and autoload

From: Date: Sun, 21 Oct 2007 19:23:56 +0000
Subject: Re: Order of class resolution with namespaces and autoload
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-32904@lists.php.net to get a copy of this message
I don't think this helps; it means that you need to use the local syntax every time you use a class, instead of importing it once, and it doesn't resolve the fact that if you use a non-fully-qualified classname (like Directory, for a different example), you need to say ::Directory or else if a previous file in your namespace has defined a Directory class, the class you end up using changes.
I'm not sure I follow you. If you intend to always use internal one, why you define the local one? If you sometimes intend to use one and sometimes another - I propose you a way to ensure the right one is always used, this without using potentially long full name. I must be missing something here - can you specify what exactly you want it to be? You do understand that if you insist on always using unqualified name, it must work some consistent way, and this way can not satisfy all possible scenarios because they are contradictory?
This unpredictability is I think the worst part of the current implementation.
There's no "unpredictability" - the behavior is entirely predictable, you just don't like it :) That's like saying that function call is unpredictable, because if you don't define the function it produces an error. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32904) next »