Bug #63012 [Opn->Dup]: register_shutdown_function is not called after error in __toString
| From: | laruence@php.net | Date: | Wed, 05 Sep 2012 03:06:37 +0000 |
| Subject: | Bug #63012 [Opn->Dup]: register_shutdown_function is not called after error in __toString | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173180@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63012&edit=1
ID: 63012
Updated by: laruence@php.net
Reported by: david at grudl dot com
Summary: register_shutdown_function is not called after error
in __toString
-Status: Open
+Status: Duplicate
Type: Bug
Package: Scripting Engine problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
oh, sorry, I was wrong, this is similar as #61767,
see https://bugs.php.net/bug.php?id=61767
thanks
Previous Comments:
------------------------------------------------------------------------
[2012-09-05 03:04:10] laruence@php.net
it's a compile error, not a runtime error.
so,, it's expected behavior
------------------------------------------------------------------------
[2012-09-04 17:55:47] david at grudl dot com
Description:
------------
Functions registered using register_shutdown_function are called after all fatal errors, except
error "Method __toString() must not throw an exception".
Test script:
---------------
<?php
class Test
{
function __toString()
{
throw new Exception;
}
}
register_shutdown_function(function(){
echo 'Hello';
});
echo new Test;
Expected result:
----------------
writes 'Hello'
Actual result:
--------------
shutdown function is not called
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63012&edit=1