Commit 353af24dc38 for php.net
commit 353af24dc385a77443f34e6812c1fb3ef10ddea0
Merge: f90dd1ce6f7 96f29013e0c
Author: Saki Takamachi <saki@php.net>
Date: Sat Sep 5 10:21:36 2026 +0900
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Fixed the behavior when using FETCH_DEFAULT (#21864)
diff --cc ext/pdo/pdo_stmt.c
index 5d8b4089ca0,51c2f58c6c2..39ac9cb1ce6
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@@ -1624,9 -1718,18 +1624,9 @@@ bool pdo_stmt_setup_fetch_mode(pdo_stmt
uint32_t constructor_arg_num = mode_arg_num + 2;
uint32_t total_num_args = mode_arg_num + variadic_num_args;
- switch (stmt->default_fetch_type) {
- case PDO_FETCH_INTO:
- if (!Z_ISUNDEF(stmt->fetch.into)) {
- zval_ptr_dtor(&stmt->fetch.into);
- ZVAL_UNDEF(&stmt->fetch.into);
- }
- break;
- default:
- ;
- }
+ pdo_stmt_free_default_fetch_mode(stmt);
- stmt->default_fetch_type = PDO_FETCH_BOTH;
+ stmt->default_fetch_type = stmt->dbh->default_fetch_type;
flags = mode & PDO_FETCH_FLAGS;