Hi!
Well, its not like the person is getting Y when he is expecting X. Both classes have the same name after all, so there is some relation between
They don't have the same name - two classes can't have the same name. And "relation" is definitely not enough - you really do not want to get generic \Exception instead of \My\Very\Specific\Exception - it would probably break all your error handling. That's like having a date with a pretty woman and getting her 85-year-old grand-uncle instead - the relation is there, but it's definitely not what you were going for :)
these two classes. More importantly its the users choice to enable this in __autoload(). As all frameworks got that its the end users job to implement autoload, I would not worry soo much in this case.
I do not see a need for autoload to substitute different classes instead of ones that are requested. autoload has very specific function - to load classes. To override it with tricks that substitute one class for another is the runkit domain, and IMHO should stay there. It would seriously complicate matters everywhere (if you load the class, you can no longer be sure successful loading have indeed loaded you the class you asked for!) and appears completely unnecessary hack.
-- 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