Commit a6566e776d4 for php.net

commit a6566e776d4eb28a6a6dd57964fc7ac4846e7bc1
Merge: 49a74a83a35 7bd27e73e9d
Author: Saki Takamachi <saki@sakiot.com>
Date:   Fri Apr 24 17:15:20 2026 +0900

    Merge branch 'PHP-8.4' into PHP-8.5

    * PHP-8.4:
      Fix GH-20214: PDO::FETCH_DEFAULT unexpected behavior with PDOStatement::setFetchMode (#21434)

diff --cc NEWS
index 42cbe1c875c,b9576a45608..a18cc501762
--- a/NEWS
+++ b/NEWS
@@@ -1,10 -1,12 +1,12 @@@
  PHP                                                                        NEWS
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 -?? ??? ????, PHP 8.4.22
 +?? ??? ????, PHP 8.5.7

-
+ - PDO:
+   . Fixed bug GH-20214 (PDO::FETCH_DEFAULT unexpected behavior with
+     setFetchMode). (iliaal)

 -07 May 2026, PHP 8.4.21
 +07 May 2026, PHP 8.5.6

  - Core:
    . Fixed bug GH-19983 (GC assertion failure with fibers, generators and
diff --cc ext/pdo/pdo_stmt.c
index 5d8b4089ca0,2ae3b1dd9e8..e4ef3cc0005
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@@ -1630,7 -1733,11 +1630,11 @@@ bool pdo_stmt_setup_fetch_mode(pdo_stmt

  	flags = mode & PDO_FETCH_FLAGS;

+ 	if ((mode & ~PDO_FETCH_FLAGS) == PDO_FETCH_USE_DEFAULT) {
+ 		mode = stmt->dbh->default_fetch_type | flags;
+ 	}
+
 -	if (!pdo_stmt_verify_mode(stmt, mode, mode_arg_num, false)) {
 +	if (!pdo_verify_fetch_mode(stmt->default_fetch_type, mode, mode_arg_num, false)) {
  		return false;
  	}