Re: [RFC]: Change Default mysqli Error Mode

From: Date: Mon, 25 Jan 2021 16:10:10 +0000
Subject: Re: [RFC]: Change Default mysqli Error Mode
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-112987@lists.php.net to get a copy of this message
>
> Moreover, I'd rather we get rid of the warning modes all together as they
> make the least sense to me.
> Either you're handling the failures explicitly anyway and you use the
> silent mode, or you don't and want it to throw with the exception mode.
> The warning mode is literally the worst of both worlds, it doesn't fail on
> failure so you need to check for failure manually,
> and you need to suppress the warnings because otherwise you get false
> negatives.
>
> Best regards,
>
> George P. Banyard
>

I'd just like to say amen to that.

Please move as much code as possible to throwing exceptions, and get rid of
warnings. Most of the time when a warning is thrown in PHP, what you
actually want is to deal with it, or stop execution.

- Benjamin


Thread (39 messages)

« previous php.internals (#112987) next »