Merge branch 'PHP-8.2'

* PHP-8.2:
  Fix GH-11451: Invalid associative array containing duplicate keys
This commit is contained in:
nielsdos 2023-06-15 21:56:40 +02:00
commit 035105b252
2 changed files with 28 additions and 1 deletions

View file

@ -1985,7 +1985,9 @@ PHP_METHOD(SQLite3Result, fetchArray)
Z_ADDREF(data);
}
}
zend_symtable_add_new(Z_ARR_P(return_value), result_obj->column_names[i], &data);
/* Note: we can't use the "add_new" variant here instead of "update" because
* when the same column name is encountered, the last result should be taken. */
zend_symtable_update(Z_ARR_P(return_value), result_obj->column_names[i], &data);
}
}
break;