Re: Throwable and Error exceptions break existing PHP 5.x code
| From: | Andrea Faulds | Date: | Tue, 12 Jan 2016 04:47:46 +0000 |
| Subject: | Re: Throwable and Error exceptions break existing PHP 5.x code | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-90535@lists.php.net to get a copy of this message | ||
Hi Adam,
Adam Harvey wrote:
On 11 January 2016 at 06:05, Rowan Collins <rowan.collins@gmail.com> wrote: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/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.