php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31304 Exceptions in destructor cause non descript fatal
Submitted: 2004-12-26 17:06 UTC Modified: 2011-01-16 22:19 UTC
Votes:8
Avg. Score:5.0 ± 0.0
Reproduced:8 of 8 (100.0%)
Same Version:1 (12.5%)
Same OS:4 (50.0%)
From: jhargis at gmail dot com Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 5.0.3 OS: Debian Linux 2.4.27-1-386
Private report: No CVE-ID: None
 [2004-12-26 17:06 UTC] jhargis at gmail dot com
Description:
------------
When the destructor issues an exception, it goes unhandled (obviously), however tossing a fatal does not seem like the appropriate course of action.

Fatal error: Exception thrown without a stack frame in Unknown on line 0

Reproduce code:
---------------
<?php
class MyClass {
  function __destruct(){
    throw new Exception('fail');
  }
}
$n = new MyClass();
?>

Expected result:
----------------
A warning?  Something other than a non descriptive fatal.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-10 22:00 UTC] tony2001@php.net
Throwing an exception is fatal error by it's nature. 
The error message clearly says what's wrong.
Why do you expect warning or anything else ?

 [2005-01-31 22:28 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2011-01-16 22:19 UTC] stas@php.net
-Status: No Feedback +Status: Duplicate
 [2011-01-16 22:19 UTC] stas@php.net
See bug #47143
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC