ext/pdo: Move assignment to declaration for clarity

This commit is contained in:
Gina Peter Banyard 2025-01-07 22:05:28 +00:00
parent 8c27553538
commit e5c415cd3a
No known key found for this signature in database
GPG key ID: 3306078E3194AEBD

View file

@ -936,8 +936,8 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
case PDO_FETCH_NAMED: case PDO_FETCH_NAMED:
/* already have an item with this name? */ /* already have an item with this name? */
{ {
zval *curr_val; zval *curr_val = zend_hash_find(Z_ARRVAL_P(return_value), column_name);
if ((curr_val = zend_hash_find(Z_ARRVAL_P(return_value), stmt->columns[i].name))) { if (curr_val != NULL) {
zval arr; zval arr;
if (Z_TYPE_P(curr_val) != IS_ARRAY) { if (Z_TYPE_P(curr_val) != IS_ARRAY) {
/* a little bit of black magic here: /* a little bit of black magic here: