Hi Adam,

Adam Harvey wrote:
On 11 January 2016 at 06:05, Rowan Collins <rowan.coll...@gmail.com> wrote:
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.

Agreed entirely (as I also said last time this came up). I also don't
want a third path involving a set_throwable_handler() or similar; we
have one too many error handling paths already.

One problematic thing that we _can_ help mitigate is that the first
section of the backward incompatible changes page in the manual starts
with the changes to error and exception handling, but never mentions
this specific issue (type declarations on the exception handler
breaking). That's entirely my fault (I've mentioned it enough in
conference talks that I guess I thought I'd documented it, but
hadn't), and I'll go fix that now.

Since functions like that no longer concern just exceptions, but now the broader notion of "throwables", perhaps they should be renamed? It would make sense to me if it were now set_throwable_handler(), with an alias in place for the old name to avoid breaking compatibility.

Thanks.

--
Andrea Faulds
https://ajf.me/

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

Reply via email to