Re: [RFC] [Discussion] SQLite3: remove warnings, move to exceptions
| From: | BohwaZ | Date: | Tue, 25 Oct 2022 12:10:14 +0000 |
| Subject: | Re: [RFC] [Discussion] SQLite3: remove warnings, move to exceptions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118883@lists.php.net to get a copy of this message | ||
> As others have said, the correct, responsible way to do this would be
> to make it gradual and keep warnings working until 9.0. I would
> recommend:
>
> 1. 8.3, enableExceptions(false) raises E_DEPRECATED.
> 2. 9.0 enableExceptions() defaults to true, and calling it with false
> is an Error. (Calling it with true still works, but is a no-op.) 3.
> 10.0 Remove enableExceptions() entirely.
>
> The behavior then only changes on major versions.
Thank you, I updated the RFC in that direction. The sad part is that it
will take a very long time before PHP 10.0 is released :(
> I think we already did this for PDO, didn't we? It makes sense to do
> it for SQLite, too.
Slightly different:
https://wiki.php.net/rfc/pdo_default_errmode
PDO made the change to throwing exceptions without going through a
deprecation.
Maybe what I would prefer for SQLite3 is a middle-ground:
* we keep ''enableExceptions(false)'' with no plan to remove it ->
thinking about it, it doesn't really matter if you prefer warnings,
and it would be easy to keep it that way
* but we make SQLite3 throw exceptions by default directly in PHP 8.3,
like it was done with PDO 2 years ago.
That way you can keep the same behaviour as before just by adding
enableExceptions(false) to your code, and it will not break.
That seems like a better compromise no?