Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12005 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23874 invoked by uid 1010); 8 Aug 2004 14:17:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23850 invoked by uid 1007); 8 Aug 2004 14:17:47 -0000 Message-ID: <20040808141747.23849.qmail@pb1.pair.com> To: internals@lists.php.net Date: Sun, 08 Aug 2004 10:17:47 -0400 User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 68.221.60.174 Subject: Destructors will not be called after an exception is caught? From: nforbes@php.net (Noel Forbes) 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