Re: Deprecation of the Error Control Operator (@ symbol)
| From: | Ferenc Kovacs | Date: | Tue, 05 Jan 2016 18:09:32 +0000 |
| Subject: | Re: Deprecation of the Error Control Operator (@ symbol) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-90119@lists.php.net to get a copy of this message | ||
On Tue, Jan 5, 2016 at 6:53 PM, Sara Golemon <pollita@php.net> wrote:
> On Tue, Jan 5, 2016 at 9:37 AM, Andrea Faulds <ajf@ajf.me> wrote:
> >> How about a global "disable error suppression" setting? That way a
> >> project lead could enforce it for their codebase (and guarantee that
> >> devs "aren't lazy"), but PHP doesn't lose its pragmatism?
> >
> > I don't think that would work out too well. Remember that many projects
> have
> > error handles which convert all errors to exceptions: if you disable @ in
> > those projects, wouldn't their code break?
> >
> Nope.
> Supressed errors already reach custom error handlers:
> https://3v4l.org/TG8aA
>
sure and most projects check the error_reporting() level against the $errno
like in the manual:
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting
return;
}
@ changes the error_reporting() level for that particular call, so those
custom error handler won't throw exceptions for the suppressed errors but
when you remove/nop @ their code would throwing stuff left and right.
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu