On Mon, Jan 25, 2021 at 7:33 PM Christian Schneider <cschn...@cschneid.com> wrote:
> Am 25.01.2021 um 18:22 schrieb G. P. B. <george.bany...@gmail.com>: > > 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. > > Defaults matter. Most people will *not* do this step and their code will > fail on upgrade. > > > 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. > > Agree to disagree. > > If I have the choice to make the smoothen the transition centrally with > PHP defaults or rely on each user to do it manually by proactively setting > warning modes I prefer the defaults way. > > Remember: I am not advocating staying in the warning mode, I'm just seeing > it as a useful intermediate step for legacy stuff we want to fix. > > - Chris > > Hi Chris, I think PHP is far from targeting a zero cost on version upgrade for projects. There will be other parts that will require testing, whatever you do. Trying to optimize this to reduce the 1 line quick fix that could be easily read in the documentation at https://www.php.net/manual/en/migration81.php sounds to me like we're trying too hard to reduce this cost, ignoring others. Other technical costs would be to not switch earlier to new exception mode as long as the default will cover the cases. I am thinking about this with a legacy system in mind that is long due on exception handling for the database layer. I know that having exceptions by default would spark an interest in developers' minds to do this change sooner rather than later because they will feel the default is the recommended way. Due to bandwidth allocation, they might add the line there, but a task will be created to fix it in the next few months, maybe a year. There will be a cost of upgrading. New scenarios and tests that might not even exist currently, negative flow scenarios. Regards, Alex