Re: Order of class resolution with namespaces and autoload

From: Date: Sat, 20 Oct 2007 23:06:58 +0000
Subject: Re: Order of class resolution with namespaces and autoload
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-32891@lists.php.net to get a copy of this message
my own namespace. And the fact that changes to what classes PHP provides can change the order of class resolution seems like unnecessary fragility to me.
I agree that it is not ideal way for all setups, however the alternative is worse - it leads to more problems.
I am not understanding why the extra autoload for system classes is necessary (I do understand why my initial re-ordering of include rules would cause two autoload calls and I agree that that is an awful idea now).
Because if you say "Exception" inside any namespace, we should check if Foo::Exception not exists anywhere, which means full search of all autoloading possibilities. Only after we ensured that no such class exists anywhere, we might use Exception. Since using system classes is much more frequent than overloading them, performance would greatly suffer each time you use system class name inside namespace. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32891) next »