On Tue, Oct 25, 2022, at 7:10 AM, BohwaZ wrote: >> 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 :(
Yes, but as of 9.0 it won't do anything. The cost of leaving it there for an extra few years as a no-op is very small compared to the benefit of an easier upgrade path. This way, people can leave enableExceptions(true) in their codebase and it will work without difference from 9.4 back to... ever? Those are the people doing it right. Be nice to those people. :-) It would only be something they need care about in 10.0, by which point dropping support for PHP 8 and earlier would be a no-brainer. >> 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. Well that was silly. > 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? No, because the goal should be to get everything consistent on using exceptions always. The mixed-mode error handling is a mess that benefits no one and makes collaboration harder. Moving toward all-exceptions is the right way to do it, just in a graceful fashion. --Larry Garfield -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php