diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 71cdf7937d99..055ca63ab67f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1540,7 +1540,7 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo if (Z_TYPE_P(current) == IS_ARRAY) { zval *current_element; - ZEND_HASH_FOREACH_VAL(HASH_OF(current), current_element) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(current), current_element) { add_simple_field(mime, string_key, current_element); } ZEND_HASH_FOREACH_END(); @@ -2186,7 +2186,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_POSTFIELDS: if (Z_TYPE_P(zvalue) == IS_ARRAY) { - if (zend_hash_num_elements(HASH_OF(zvalue)) == 0) { + if (zend_hash_num_elements(Z_ARRVAL_P(zvalue)) == 0) { /* no need to build the mime structure for empty hashtables; also works around https://github.com/curl/curl/issues/6455 */ curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, "");