Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92814 invoked by uid 1010); 23 Jun 2004 09:58:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92687 invoked from network); 23 Jun 2004 09:58:03 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 23 Jun 2004 09:58:03 -0000 Received: (qmail 2550 invoked from network); 23 Jun 2004 09:58:01 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 23 Jun 2004 09:58:01 -0000 Message-ID: <5.1.0.14.2.20040623000747.02024828@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Wed, 23 Jun 2004 00:12:22 +0100 To: "Robert Janeczek" ,internals@lists.php.net In-Reply-To: <20040619163656.68076.qmail@pb1.pair.com> References: <20040619160702.82169.qmail@pb1.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Re: throwing exceptions in __autoload From: andi@zend.com (Andi Gutmans) 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