Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12024 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63605 invoked by uid 1010); 9 Aug 2004 05:28:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63556 invoked from network); 9 Aug 2004 05:28:18 -0000 Received: from unknown (HELO jan.prima.de) (83.97.50.139) by pb1.pair.com with SMTP; 9 Aug 2004 05:28:18 -0000 Received: from BAUMBART (p508EAF4A.dip.t-dialin.net [::ffff:80.142.175.74]) (IDENT: HydraIRC, AUTH: LOGIN tobi) by jan.prima.de with esmtp; Mon, 09 Aug 2004 05:25:31 +0000 Date: Mon, 9 Aug 2004 07:28:10 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1815162431.20040809072810@marcus-boerger.de> To: Noel Forbes CC: internals@lists.php.net In-Reply-To: <20040808141747.23849.qmail@pb1.pair.com> References: <20040808141747.23849.qmail@pb1.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 0.43 Subject: Re: [PHP-DEV] Destructors will not be called after an exception is caught? From: helly@php.net (Marcus Boerger) Hello Noel, i suppose one of your destructors did throw an exception. But you didn't get any output from it. Try either 5.0.0-dev or 5.1.0-dev where the shutdown order wasaddressed again. A reproducing script would be this: php -r 'class t{function __destruct(){throw new exception(__METHOD__);}}$o=new t;' regards marcus Sunday, August 8, 2004, 4:17:47 PM, you wrote: > Hello all, > You'll have to excuse my ignorance if something like this has already > been posted. > In my process of writing complicated-for-the-sake-of-complicated scripts > (:D), I came across a very strange error: > Fatal error: Exception thrown without a stack frame in Unknown on line 0 > What was happening was that an Exception was being thrown in a class, > which in turn was caught by this (in psuedo-code): > try { > load_classes(); > } > catch (Exception $e) { > echo $e; > } > After the exception was caught and had been successfully printed to the > screen, the above fatal error occured. The cause of this error was a > __destruct() method in another class. Since the catch had killed the > script, the destructor was not able to execute, as far as I can tell. > I've confirmed this on PHP 5.0.0 on FreeBSD and PHP 5.0.0 RC3 on Win32. > Is this error message appropriate? Should this even be happening at all? > Any replies are welcomed. > Regards, > Noel Forbes -- Best regards, Marcus mailto:helly@php.net