From 6347535735c6fce588a45483d71f05688bc9b108 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sun, 16 Nov 2025 15:28:26 +0100 Subject: [PATCH] Link to PHP Docs about MySQLi report mode; add a TODO Summary: Link to canonical docs explaining the current `mysqli_report(MYSQLI_REPORT_OFF)` behavior. Remove useless reference to old upstream task which is just a generic PHP 8.1 issue. For reference, related commit was https://web.archive.org/web/20250326045742/http://secure.phabricator.com/D21744 Test Plan: None; it is a comment only. Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D26499 --- .../mysql/AphrontMySQLiDatabaseConnection.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/infrastructure/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php b/src/infrastructure/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php index c290780882..c9bba8503c 100644 --- a/src/infrastructure/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php +++ b/src/infrastructure/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php @@ -57,11 +57,13 @@ final class AphrontMySQLiDatabaseConnection } } - // See T13588. In PHP 8.1, the default "report mode" for MySQLi has - // changed, which causes MySQLi to raise exceptions. Disable exceptions - // to align behavior with older default behavior under MySQLi, which - // this code expects. Plausibly, this code could be updated to use - // MySQLi exceptions to handle errors under a wider range of PHP versions. + // In PHP 8.1, the default "report mode" for MySQLi has changed, which + // causes MySQLi to raise exceptions. Disable exceptions to align behavior + // with older default behavior under MySQLi, which this code expects. + // https://www.php.net/manual/mysqli-driver.report-mode.php + // https://www.php.net/manual/migration81.incompatible.php#migration81.incompatible.mysqli + // TODO: Plausibly, this code could be updated to use MySQLi exceptions + // to handle errors. See https://we.phorge.it/T16341 mysqli_report(MYSQLI_REPORT_OFF); $conn = mysqli_init(); -- 2.51.2