On Mon, 25 Jan 2021 at 16:25, Christian Schneider <cschn...@cschneid.com> wrote:
> Am 25.01.2021 um 16:59 schrieb G. P. B. <george.bany...@gmail.com>: > > The BC break is totally minimal as it's a one line of code that needs to > be added (and for all intent and purposes should already be done). > > That does not change the fact that it is a BC break which should be > treated accordingly. > > You are basically advocating people should add > mysqli_report(MYSQLI_REPORT_OFF) to their setup which will totally defeat > the purpose of the change. > Or (probably more what you have in mind) that they should add > mysqli_report(MYSQLI_REPORT_ERROR) now (to prepare for the change) and > switch to MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT later once they know > they are ready. > And this is exactly what I think should be done by the PHP default so > people don't have to go through this manually. > > > 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. > > This is where you are missing a key component: I want to go through a > phase where I will notice parts where manual error handling (or exception > handling after the change) is missing without having my application abort. > This is what warnings are good for. > > To some of us this is a very valuable step when upgrading. > > - Chris > I've never said there is no BC break, and frankly this change (and other similar ones) should probably have been done in PHP 8 at the same time with PDO. And yes I'm basically advocating for people to add mysqli_report(MYSQLI_REPORT_ERROR) (or even mysqli_report(MYSQLI_REPORT_OFF) if they fancy) to their setup, I'm even advocating for them to do it *right now* such that they can catch anything ahead of time. Moreover, this proposal does not prevent you from using the warning mode instead of jumping to exceptions directly, the key point is that you need to specify it, and I personally believe that having the warning mode as the *default* mode is the worst choice for the reasons I mentioned previously. The removal of the warning modes is completely orthogonal to this proposal, and I agree it is a very useful tool for transitioning to the exception mode, but this transition can already be done in PHP 5, 7 and 8. The grace period for completing this transition is from whenever you want to whenever, if ever, the warning mode gets deprecated and removed. On the note that a one line code change is not a good enough justification for saner defaults, I don't know what to say. At worst you need to find all usages of a connection start and add the line to downgrade the error reporting (even to silence if too many warnings are emitted). I don't see what testing needs to be done, you're reverting to the previous state which supposedly is already working. Best regards, George P. Banyard