Skip to content

Commit ab9b356

Browse files
kamil-tekielanikic
andcommitted
Change zval to a HashTable
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
1 parent a14e4de commit ab9b356

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/mysqli/mysqli_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,12 +811,12 @@ PHP_FUNCTION(mysqli_stmt_execute)
811811
{
812812
MY_STMT *stmt;
813813
zval *mysql_stmt;
814-
zval *input_params = NULL;
814+
HashTable *input_params = NULL;
815815
#ifndef MYSQLI_USE_MYSQLND
816816
unsigned int i;
817817
#endif
818818

819-
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|a!", &mysql_stmt, mysqli_stmt_class_entry, &input_params) == FAILURE) {
819+
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|h!", &mysql_stmt, mysqli_stmt_class_entry, &input_params) == FAILURE) {
820820
RETURN_THROWS();
821821
}
822822
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -830,7 +830,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
830830
unsigned int param_count;
831831
MYSQLND_PARAM_BIND *params;
832832

833-
hash_num_elements = zend_hash_num_elements(Z_ARRVAL_P(input_params));
833+
hash_num_elements = zend_hash_num_elements(input_params);
834834
param_count = mysql_stmt_param_count(stmt->stmt);
835835
if (hash_num_elements != param_count) {
836836
zend_argument_value_error(ERROR_ARG_POS(2), "must consist of exactly %d elements, %d present", param_count, hash_num_elements);
@@ -844,7 +844,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
844844
}
845845

846846
index = 0;
847-
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(input_params), tmp) {
847+
ZEND_HASH_FOREACH_VAL(input_params, tmp) {
848848
ZVAL_COPY_VALUE(&params[index].zv, tmp);
849849
params[index].type = MYSQL_TYPE_VAR_STRING;
850850
index++;

0 commit comments

Comments
 (0)