Bug #63012 [Opn]: register_shutdown_function is not called after error in __toString
| From: | laruence@php.net | Date: | Wed, 05 Sep 2012 03:04:10 +0000 |
| Subject: | Bug #63012 [Opn]: register_shutdown_function is not called after error in __toString | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173179@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
Type: Bug
Package: Scripting Engine problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
it's a compile error, not a runtime error.
so,, it's expected behavior
Previous Comments:
------------------------------------------------------------------------
[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