On 05.11.2008, at 01:05, Stanislav Malyshev wrote:

Hi!

or in other words give the user the ability to specify when he wants the fallback to global and not doing a fallback to global per default. That way

This would be quite complex thing since this way you can't be sure which class gets loaded when you say, e.g., Exception - and thus, if you write something like "throw new Exception("XML did not load")" and except My\XML\Parser\Exception and have catch for it but get just Exception your application would happily unroll to the top and fail.

I think actually knowing what class is going to be loaded is a good idea and overriding loader behavior so it's asked for one class and loads completely different one is not a good idea. One would expect if he asks for class X he gets class X, not class Y.

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 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.

Just a question: How hard would it be to implement in case we do want this?

regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]




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

Reply via email to