e-sites / php-mysql-mysqli-wrapper

MIT License
99 stars 40 forks source link

Disable exceptions at PHP 8.1 #17

Closed killerbees19 closed 5 months ago

killerbees19 commented 2 years ago

Quote from the manual:

As of PHP 8.1.0, the default setting is MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT. Previously, it was MYSQLI_REPORT_OFF.

Without this commit every failed query will throw a mysqli_sql_exception and this will break legacy code which is expecting false as return value from certain functions.

With this change it's still possible to override the reporting mode after including this wrapper. 🤓