[wp-trac] [WordPress Trac] #52825: [PHP 8.1] MySQLi error reporting value changes
WordPress Trac
noreply at wordpress.org
Tue Mar 16 06:15:46 UTC 2021
#52825: [PHP 8.1] MySQLi error reporting value changes
--------------------------+-----------------------------
Reporter: ayeshrajans | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version:
Severity: normal | Keywords: php81 has-patch
Focuses: |
--------------------------+-----------------------------
I suppose this is the first ticket for PHP 8.1 - Exciting :)
In PHP 8.1, the default error reporting is set to always throw an
exception, as opposed to emitting a warning. WordPress gracefully handles
the database errors by inspecting the error codes.
- [https://php.watch/versions/8.1/mysqli-error-mode PHP 8.1: MySQLi:
Default error mode set to exceptions]
- [https://wiki.php.net/rfc/mysqli_default_errmode RFC]
I suggest that WordPress set the error reporting mode to off, which is the
default value prior to this change. Unless we do this, any bad MySQLi
connection will throw an exception, leading to a WSOD, or a blank page
with the uncaught exception error.
(linking to a PR)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52825>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list