Edit report at https://bugs.php.net/bug.php?id=63012&edit=1

 ID:                 63012
 Updated by:         larue...@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] larue...@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

Reply via email to