Giovanni Giacobbi wrote on 11/01/2016 13:31:
set_exception_handler(callback function, bool also_throwables = false);

The new parameter "also_throwables" defaults to false, so the same
behaviour as before is preserved. If you want it to catch also the new PHP7
Error exceptions, you can just set it to true.

This is an interesting idea, but other than the specific transition to PHP 7, I'm not sure when it would be used.

Put it this way: if Errors existed when you first wrote this code, would you want to handle them using your custom handler functions, or would you prefer them to the fall through to the default server White Screen of Doom? My guess is that you'd want to pass them to the handler, even if it immediately checked "if ($e instanceOf Error)" and used a different output style.

Since set_exception_handler() is intended as a last-ditch "something's gone very wrong" function anyway, I think it receiving all Throwables makes sense, even if the BC break in your scenario is unfortunate.

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to