Fix default `mysqli` error reporting mode for PHP 8.1+ by schlessera · Pull Request #5582 · wp-cli/wp-cli
Starting with PHP 8.1, mysqli has a new default error reporting mode that throws exceptions.
As WordPress handles error conditions on its own, this is not needed.
The default error mode is already adapted with WP Core 5.9+, but on older versions the above changes means that you cannot even update WordPress sites on PHP 8.1, as they fatal with an uncaught exception.
Therefore, WP-CLI also sets the default error reporting mode now to avoid these fatals.