Re: [RFC][DISCUSSION] Error Exceptions mode
| From: | Dan Ackroyd | Date: | Sat, 30 May 2020 17:56:11 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Error Exceptions mode | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110316@lists.php.net to get a copy of this message | ||
On Fri, 22 May 2020 at 17:09, Katie Volz <iggyvolz@gmail.com> wrote:
>
> Hello internals,
>
> I want to start a discussion on an RFC to add a declare() statement to
> convert all errors triggered within a file to exceptions.
>
Hi Katie/Iggy,
I'm not sure this is the right thing to do.
Having internal code just throw generic ErrorExceptions does not get
PHP to a place where it is possible for users to listen for individual
error types, which I think is the biggest problem with the current
situation.
I won't duplicate my message from another thread, but I think there is
an alternative path: https://news-web.php.net/php.internals/110315
> The error handler cannot be set in library code without affecting other libraries
We could also just make the default error handler convert all
errors/warnings to exceptions.....I've been doing that for my error
handlers for years, and I believe it's the right thing to do for 95%+
of applications. Though it does require some use of the silence
operator, which apparently some people find disconcerting.
cheers
Dan
Ack