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 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