Don't have access to a running version of PHP right now (on vacation) but by design __autoload() isn't supposed to propagate an exception. It's your last chance to load the class and if it fails, then it dies. If this isn't exactly what's happening then there's a problem.
The reason for this is, that due to __autoload() being called from quite a few different contexts it is not clear (at least I can't quite remember) how this will affect the run-time. It might end up being very problematic as some code also assumes that it succeeds. I personally think, that in most cases, there aren't very good reasons to throw exceptions from it. How come you can't declare the class when __autoload() is called but you can do so later? In such a weird situation, you could declare a proxy object with the same name which relays all calls to the real class if/when you can load it.
So basically, I understand what you're saying, but I don't see a very compelling reason to work very hard now to make this work differently.


Andi

At 05:38 PM 6/19/2004 +0200, Robert Janeczek wrote:
i found http://bugs.php.net/bug.php?id=26193 which explains my problem,
but...

the reason of problems with catching this exception seems to be no stack
frame added. can i set it by myself somehow in derived exception class?

my idea to working around this problem is to create temporary class (not
object), but i`m not sure if it can be done. in case of error i would create
string with class declaration, 'eval' it and throw exception. specified
exception for this problem would accept class name as one of params and
undeclare the class. i can`t however find any way of undeclaring/redeclaring
classes - is it possible?

rash

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

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



Reply via email to