From e5c415cd3a9574619a264ebb3408304fa91f4ac8 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 7 Jan 2025 22:05:28 +0000 Subject: [PATCH] ext/pdo: Move assignment to declaration for clarity --- ext/pdo/pdo_stmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index ccb952a5c2a..7479c09957b 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -936,8 +936,8 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h case PDO_FETCH_NAMED: /* already have an item with this name? */ { - zval *curr_val; - if ((curr_val = zend_hash_find(Z_ARRVAL_P(return_value), stmt->columns[i].name))) { + zval *curr_val = zend_hash_find(Z_ARRVAL_P(return_value), column_name); + if (curr_val != NULL) { zval arr; if (Z_TYPE_P(curr_val) != IS_ARRAY) { /* a little bit of black magic here: