summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-09-24 22:39:59 +0300
committerDmitry Stogov <dmitry@zend.com>2015-09-24 22:39:59 +0300
commitad4fa8f75810facff8bea509249a735232235443 (patch)
tree13b4b2f3df2a2df85a8d3b9702024ac8213f37a7
parentabf6a0b376b42e0ce60da039b11c6fdf994431fb (diff)
downloadphp-git-ad4fa8f75810facff8bea509249a735232235443.tar.gz
Fixed incorrect usage of HASH_OF() macro. Replaced HASH_OF() with more appropriate Z_ARRVAL_P() or Z_OBJPROP_P().
-rw-r--r--ext/com_dotnet/com_com.c10
-rw-r--r--ext/com_dotnet/com_variant.c16
-rw-r--r--ext/date/php_date.c10
-rw-r--r--ext/gd/gd.c26
-rw-r--r--ext/imap/php_imap.c2
-rw-r--r--ext/intl/collator/collator_sort.c4
-rw-r--r--ext/intl/locale/locale_methods.c6
-rw-r--r--ext/mcrypt/mcrypt_filter.c10
-rw-r--r--ext/mysqli/mysqli_embedded.c18
-rw-r--r--ext/openssl/openssl.c22
-rw-r--r--ext/pcntl/pcntl.c4
-rw-r--r--ext/phar/func_interceptors.c54
-rw-r--r--ext/soap/php_encoding.c2
-rw-r--r--ext/sockets/multicast.c4
-rw-r--r--ext/sockets/sockets.c4
-rw-r--r--ext/spl/spl_iterators.c26
-rw-r--r--ext/standard/basic_functions.c14
-rw-r--r--ext/standard/file.c52
-rw-r--r--ext/standard/filestat.c54
-rw-r--r--ext/standard/proc_open.c2
-rw-r--r--ext/standard/string.c2
-rw-r--r--ext/standard/url.c2
-rw-r--r--ext/tidy/tidy.c2
-rw-r--r--ext/wddx/wddx.c6
-rw-r--r--ext/zip/php_zip.c6
25 files changed, 176 insertions, 182 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 80ef70e7e0..fc7a04000d 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -76,7 +76,7 @@ PHP_FUNCTION(com_create_instance)
/* decode the data from the array */
- if (NULL != (tmp = zend_hash_str_find(HASH_OF(server_params),
+ if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Server", sizeof("Server")-1))) {
convert_to_string_ex(tmp);
server_name = Z_STRVAL_P(tmp);
@@ -84,28 +84,28 @@ PHP_FUNCTION(com_create_instance)
ctx = CLSCTX_REMOTE_SERVER;
}
- if (NULL != (tmp = zend_hash_str_find(HASH_OF(server_params),
+ if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Username", sizeof("Username")-1))) {
convert_to_string_ex(tmp);
user_name = Z_STRVAL_P(tmp);
user_name_len = Z_STRLEN_P(tmp);
}
- if (NULL != (tmp = zend_hash_str_find(HASH_OF(server_params),
+ if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Password", sizeof("Password")-1))) {
convert_to_string_ex(tmp);
password = Z_STRVAL_P(tmp);
password_len = Z_STRLEN_P(tmp);
}
- if (NULL != (tmp = zend_hash_str_find(HASH_OF(server_params),
+ if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Domain", sizeof("Domain")-1))) {
convert_to_string_ex(tmp);
domain_name = Z_STRVAL_P(tmp);
domain_name_len = Z_STRLEN_P(tmp);
}
- if (NULL != (tmp = zend_hash_str_find(HASH_OF(server_params),
+ if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Flags", sizeof("Flags")-1))) {
convert_to_long_ex(tmp);
ctx = (CLSCTX)Z_LVAL_P(tmp);
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 1779bbdf5e..155094ca8b 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -44,10 +44,10 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
zval *item;
/* find the largest array index, and assert that all keys are integers */
- zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
- for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(z), &pos);
+ for (;; zend_hash_move_forward_ex(Z_ARRVAL_P(z), &pos)) {
- keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, &pos);
+ keytype = zend_hash_get_current_key_ex(Z_ARRVAL_P(z), &strindex, &intindex, &pos);
if (HASH_KEY_IS_STRING == keytype) {
goto bogus;
@@ -61,7 +61,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
/* allocate the structure */
bound.lLbound = 0;
- bound.cElements = zend_hash_num_elements(HASH_OF(z));
+ bound.cElements = zend_hash_num_elements(Z_ARRVAL_P(z));
sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
/* get a lock on the array itself */
@@ -69,12 +69,12 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
va = (VARIANT*)sa->pvData;
/* now fill it in */
- zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
- for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
- if (NULL == (item = zend_hash_get_current_data_ex(HASH_OF(z), &pos))) {
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(z), &pos);
+ for (;; zend_hash_move_forward_ex(Z_ARRVAL_P(z), &pos)) {
+ if (NULL == (item = zend_hash_get_current_data_ex(Z_ARRVAL_P(z), &pos))) {
break;
}
- zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, &pos);
+ zend_hash_get_current_key_ex(Z_ARRVAL_P(z), &strindex, &intindex, &pos);
php_com_variant_from_zval(&va[intindex], item, codepage);
}
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 4b74da0971..50c48eb439 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2780,7 +2780,7 @@ PHP_METHOD(DateTime, __set_state)
RETURN_FALSE;
}
- myht = HASH_OF(array);
+ myht = Z_ARRVAL_P(array);
php_date_instantiate(date_ce_date, return_value);
dateobj = Z_PHPDATE_P(return_value);
@@ -2802,7 +2802,7 @@ PHP_METHOD(DateTimeImmutable, __set_state)
RETURN_FALSE;
}
- myht = HASH_OF(array);
+ myht = Z_ARRVAL_P(array);
php_date_instantiate(date_ce_immutable, return_value);
dateobj = Z_PHPDATE_P(return_value);
@@ -3699,7 +3699,7 @@ PHP_METHOD(DateTimeZone, __set_state)
RETURN_FALSE;
}
- myht = HASH_OF(array);
+ myht = Z_ARRVAL_P(array);
php_date_instantiate(date_ce_timezone, return_value);
tzobj = Z_PHPTIMEZONE_P(return_value);
@@ -4161,7 +4161,7 @@ PHP_METHOD(DateInterval, __set_state)
RETURN_FALSE;
}
- myht = HASH_OF(array);
+ myht = Z_ARRVAL_P(array);
php_date_instantiate(date_ce_interval, return_value);
intobj = Z_PHPINTERVAL_P(return_value);
@@ -4570,7 +4570,7 @@ PHP_FUNCTION(timezone_abbreviations_list)
add_assoc_null_ex(&element, "timezone_id", sizeof("timezone_id") - 1);
}
- abbr_array_p = zend_hash_str_find(HASH_OF(return_value), entry->name, strlen(entry->name));
+ abbr_array_p = zend_hash_str_find(Z_ARRVAL_P(return_value), entry->name, strlen(entry->name));
if (!abbr_array_p) {
array_init(&abbr_array);
add_assoc_zval(return_value, entry->name, &abbr_array);
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 3f3c629dac..694eed11ad 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1438,9 +1438,9 @@ PHP_FUNCTION(imagesetstyle)
}
/* copy the style values in the stylearr */
- stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(HASH_OF(styles)), 0);
+ stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(Z_ARRVAL_P(styles)), 0);
- ZEND_HASH_FOREACH_VAL(HASH_OF(styles), item) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(styles), item) {
stylearr[index++] = zval_get_long(item);
} ZEND_HASH_FOREACH_END();
@@ -3859,7 +3859,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
zend_string *key;
/* walk the assoc array */
- ZEND_HASH_FOREACH_STR_KEY_VAL(HASH_OF(EXT), key, item) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(EXT), key, item) {
if (key == NULL) {
continue;
}
@@ -4548,28 +4548,28 @@ PHP_FUNCTION(imagecrop)
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") -1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") -1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing height");
@@ -4731,28 +4731,28 @@ PHP_FUNCTION(imageaffine)
}
if (z_rect != NULL) {
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") - 1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing height");
@@ -4801,14 +4801,14 @@ PHP_FUNCTION(imageaffinematrixget)
php_error_docref(NULL, E_WARNING, "Array expected as options");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(options), "x", sizeof("x") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(options), "x", sizeof("x") - 1)) != NULL) {
x = zval_get_double(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
- if ((tmp = zend_hash_str_find(HASH_OF(options), "y", sizeof("y") - 1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(options), "y", sizeof("y") - 1)) != NULL) {
y = zval_get_double(tmp);
} else {
php_error_docref(NULL, E_WARNING, "Missing y position");
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 841143f5b3..cbb8680676 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -1167,7 +1167,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (params) {
zval *disabled_auth_method;
- if ((disabled_auth_method = zend_hash_str_find(HASH_OF(params), "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR") - 1)) != NULL) {
+ if ((disabled_auth_method = zend_hash_str_find(Z_ARRVAL_P(params), "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR") - 1)) != NULL) {
switch (Z_TYPE_P(disabled_auth_method)) {
case IS_STRING:
if (Z_STRLEN_P(disabled_auth_method) > 1) {
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index 68e9ccf537..deb2f7b8d9 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -309,7 +309,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
/* Set 'compare function' according to sort flags. */
INTL_G(compare_func) = collator_get_compare_function( sort_flags );
- hash = HASH_OF( array );
+ hash = Z_ARRVAL_P( array );
/* Convert strings in the specified array from UTF-8 to UTF-16. */
collator_convert_hash_from_utf8_to_utf16( hash, COLLATOR_ERROR_CODE_P( co ) );
@@ -411,7 +411,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
/*
* Sort specified array.
*/
- hash = HASH_OF( array );
+ hash = Z_ARRVAL_P( array );
if( !hash || zend_hash_num_elements( hash ) == 0 )
RETURN_TRUE;
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index e3609e5905..c47f283201 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -826,7 +826,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
smart_str_appendl(loc_name, Z_STRVAL_P(ele_value) , Z_STRLEN_P(ele_value));
return SUCCESS;
} else if(Z_TYPE_P(ele_value) == IS_ARRAY ) {
- HashTable *arr = HASH_OF(ele_value);
+ HashTable *arr = Z_ARRVAL_P(ele_value);
zval *data;
ZEND_HASH_FOREACH_VAL(arr, data) {
@@ -922,7 +922,7 @@ PHP_FUNCTION(locale_compose)
RETURN_FALSE;
}
- hash_arr = HASH_OF( arr );
+ hash_arr = Z_ARRVAL_P( arr );
if( !hash_arr || zend_hash_num_elements( hash_arr ) == 0 )
RETURN_FALSE;
@@ -1551,7 +1551,7 @@ PHP_FUNCTION(locale_lookup)
loc_range = intl_locale_get_default();
}
- hash_arr = HASH_OF(arr);
+ hash_arr = Z_ARRVAL_P(arr);
if( !hash_arr || zend_hash_num_elements( hash_arr ) == 0 ) {
RETURN_EMPTY_STRING();
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c
index 3a3f390036..b626821c7b 100644
--- a/ext/mcrypt/mcrypt_filter.c
+++ b/ext/mcrypt/mcrypt_filter.c
@@ -174,7 +174,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
return NULL;
}
- if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("mode")))) {
+ if ((tmpzval = zend_hash_str_find(Z_ARRVAL_P(filterparams), ZEND_STRL("mode")))) {
if (Z_TYPE_P(tmpzval) == IS_STRING) {
mode = Z_STRVAL_P(tmpzval);
} else {
@@ -182,7 +182,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
}
}
- if ((tmpzval=zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("algorithms_dir")))) {
+ if ((tmpzval=zend_hash_str_find(Z_ARRVAL_P(filterparams), ZEND_STRL("algorithms_dir")))) {
if (Z_TYPE_P(tmpzval) == IS_STRING) {
algo_dir = Z_STRVAL_P(tmpzval);
} else {
@@ -190,7 +190,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
}
}
- if ((tmpzval=zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("modes_dir")))) {
+ if ((tmpzval=zend_hash_str_find(Z_ARRVAL_P(filterparams), ZEND_STRL("modes_dir")))) {
if (Z_TYPE_P(tmpzval) == IS_STRING) {
mode_dir = Z_STRVAL_P(tmpzval);
} else {
@@ -198,7 +198,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
}
}
- if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("key"))) &&
+ if ((tmpzval = zend_hash_str_find(Z_ARRVAL_P(filterparams), ZEND_STRL("key"))) &&
Z_TYPE_P(tmpzval) == IS_STRING) {
key = Z_STRVAL_P(tmpzval);
key_len = (int)Z_STRLEN_P(tmpzval);
@@ -218,7 +218,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
key_len = keyl;
}
- if (!(tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("iv"))) ||
+ if (!(tmpzval = zend_hash_str_find(Z_ARRVAL_P(filterparams), ZEND_STRL("iv"))) ||
Z_TYPE_P(tmpzval) != IS_STRING) {
php_error_docref(NULL, E_WARNING, "Filter parameter[iv] not provided or not of type: string");
mcrypt_module_close(mcrypt_module);
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
index 97232ed0cb..e200a3abf6 100644
--- a/ext/mysqli/mysqli_embedded.c
+++ b/ext/mysqli/mysqli_embedded.c
@@ -51,16 +51,16 @@ PHP_FUNCTION(mysqli_embedded_server_start)
RETURN_TRUE;
}
/* get arguments */
- if ((argc = zend_hash_num_elements(HASH_OF(args)))) {
+ if ((argc = zend_hash_num_elements(Z_ARRVAL_P(args)))) {
arguments = safe_emalloc(sizeof(char *), argc + 1, 0);
arguments[0] = NULL;
- zend_hash_internal_pointer_reset_ex(HASH_OF(args), &pos);
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
- for (index = 0;; zend_hash_move_forward_ex(HASH_OF(args), &pos)) {
+ for (index = 0;; zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) {
zval **item;
- if (zend_hash_get_current_data_ex(HASH_OF(args), (void **) &item, &pos) == FAILURE) {
+ if (zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) &item, &pos) == FAILURE) {
break;
}
@@ -72,16 +72,16 @@ PHP_FUNCTION(mysqli_embedded_server_start)
}
/* get groups */
- if ((zend_hash_num_elements(HASH_OF(grps)))) {
- groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(HASH_OF(grps)) + 1, 0);
+ if ((zend_hash_num_elements(Z_ARRVAL_P(grps)))) {
+ groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(Z_ARRVAL_P(grps)) + 1, 0);
groups[0] = NULL;
- zend_hash_internal_pointer_reset_ex(HASH_OF(grps), &pos);
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(grps), &pos);
- for (index = 0;; zend_hash_move_forward_ex(HASH_OF(grps), &pos)) {
+ for (index = 0;; zend_hash_move_forward_ex(Z_ARRVAL_P(grps), &pos)) {
zval ** item;
- if (zend_hash_get_current_data_ex(HASH_OF(grps), (void **) &item, &pos) == FAILURE) {
+ if (zend_hash_get_current_data_ex(Z_ARRVAL_P(grps), (void **) &item, &pos) == FAILURE) {
break;
}
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 2ec233a7ab..a2bf8042c6 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -705,7 +705,7 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
}
}
if (key != NULL) {
- zend_hash_str_update(HASH_OF(val), key, strlen(key), &subitem);
+ zend_hash_str_update(Z_ARRVAL_P(val), key, strlen(key), &subitem);
}
}
/* }}} */
@@ -2248,7 +2248,7 @@ static X509_STORE * setup_verify(zval * calist)
}
if (calist && (Z_TYPE_P(calist) == IS_ARRAY)) {
- ZEND_HASH_FOREACH_VAL(HASH_OF(calist), item) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(calist), item) {
convert_to_string_ex(item);
if (VCWD_STAT(Z_STRVAL_P(item), &sb) == -1) {
@@ -2354,7 +2354,7 @@ static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts) /* {{{ */
/* get certs */
if (Z_TYPE_P(zcerts) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(HASH_OF(zcerts), zcertval) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(zcerts), zcertval) {
cert = php_openssl_x509_from_zval(zcertval, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
@@ -2687,7 +2687,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
subj = X509_REQ_get_subject_name(csr);
/* apply values from the dn hash */
- ZEND_HASH_FOREACH_STR_KEY_VAL(HASH_OF(dn), strindex, item) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(dn), strindex, item) {
if (strindex) {
int nid;
@@ -2760,7 +2760,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
}
}
if (attribs) {
- ZEND_HASH_FOREACH_STR_KEY_VAL(HASH_OF(attribs), strindex, item) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(attribs), strindex, item) {
int nid;
convert_to_string_ex(item);
@@ -3247,7 +3247,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* get passphrase */
- if ((zphrase = zend_hash_index_find(HASH_OF(val), 1)) == NULL) {
+ if ((zphrase = zend_hash_index_find(Z_ARRVAL_P(val), 1)) == NULL) {
php_error_docref(NULL, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
return NULL;
}
@@ -3261,7 +3261,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
}
/* now set val to be the key param and continue */
- if ((val = zend_hash_index_find(HASH_OF(val), 0)) == NULL) {
+ if ((val = zend_hash_index_find(Z_ARRVAL_P(val), 0)) == NULL) {
php_error_docref(NULL, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
TMP_CLEAN;
}
@@ -4227,7 +4227,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
/* get certs */
if (Z_TYPE_P(zrecipcerts) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(HASH_OF(zrecipcerts), zcertval) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(zrecipcerts), zcertval) {
zend_resource *certresource;
cert = php_openssl_x509_from_zval(zcertval, 0, &certresource);
@@ -4281,7 +4281,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
/* tack on extra headers */
if (zheaders) {
- ZEND_HASH_FOREACH_STR_KEY_VAL(HASH_OF(zheaders), strindex, zcertval) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
convert_to_string_ex(zcertval);
if (strindex) {
@@ -4385,7 +4385,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
/* tack on extra headers */
if (zheaders) {
- ZEND_HASH_FOREACH_STR_KEY_VAL(HASH_OF(zheaders), strindex, hval) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, hval) {
convert_to_string_ex(hval);
if (strindex) {
@@ -4906,7 +4906,7 @@ PHP_FUNCTION(openssl_seal)
&sealdata, &ekeys, &pubkeys, &method, &method_len, &iv) == FAILURE) {
return;
}
- pubkeysht = HASH_OF(pubkeys);
+ pubkeysht = Z_ARRVAL_P(pubkeys);
nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0;
if (!nkeys) {
php_error_docref(NULL, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty array");
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 6661c2a715..2cfbaa1e8e 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -871,7 +871,7 @@ PHP_FUNCTION(pcntl_exec)
if (ZEND_NUM_ARGS() > 1) {
/* Build argument list */
- args_hash = HASH_OF(args);
+ args_hash = Z_ARRVAL_P(args);
argc = zend_hash_num_elements(args_hash);
argv = safe_emalloc((argc + 2), sizeof(char *), 0);
@@ -893,7 +893,7 @@ PHP_FUNCTION(pcntl_exec)
if ( ZEND_NUM_ARGS() == 3 ) {
/* Build environment pair list */
- envs_hash = HASH_OF(envs);
+ envs_hash = Z_ARRVAL_P(envs);
envc = zend_hash_num_elements(envs_hash);
pair = envp = safe_emalloc((envc + 1), sizeof(char *), 0);
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index dc08bd424f..ab2876272c 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -568,35 +568,35 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value)
ZVAL_LONG(&stat_blocks,-1);
#endif
/* Store numeric indexes in proper order */
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_nlink);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_uid);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_gid);
-
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_rdev);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_size);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_atime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_mtime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_ctime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_blksize);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_blocks);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_dev);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_ino);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_mode);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_nlink);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_uid);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_gid);
+
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_rdev);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_size);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_atime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_mtime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_ctime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_blksize);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_blocks);
/* Store string indexes referencing the same zval*/
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0]), &stat_dev);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1]), &stat_ino);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2]), &stat_mode);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3]), &stat_nlink);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4]), &stat_uid);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5]), &stat_gid);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6]), &stat_rdev);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7]), &stat_size);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8]), &stat_atime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9]), &stat_mtime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10]), &stat_ctime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11]), &stat_blksize);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12]), &stat_blocks);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[0], strlen(stat_sb_names[0]), &stat_dev);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[1], strlen(stat_sb_names[1]), &stat_ino);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[2], strlen(stat_sb_names[2]), &stat_mode);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[3], strlen(stat_sb_names[3]), &stat_nlink);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[4], strlen(stat_sb_names[4]), &stat_uid);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[5], strlen(stat_sb_names[5]), &stat_gid);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[6], strlen(stat_sb_names[6]), &stat_rdev);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[7], strlen(stat_sb_names[7]), &stat_size);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[8], strlen(stat_sb_names[8]), &stat_atime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[9], strlen(stat_sb_names[9]), &stat_mtime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[10], strlen(stat_sb_names[10]), &stat_ctime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[11], strlen(stat_sb_names[11]), &stat_blksize);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[12], strlen(stat_sb_names[12]), &stat_blocks);
return;
}
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 5d8bf95623..c03d433951 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -3502,7 +3502,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type)
i = 0;
different = FALSE;
cur_type = prev_type = 0;
- ht = HASH_OF(array);
+ ht = Z_ARRVAL_P(array);
ZEND_HASH_FOREACH_VAL_IND(ht, tmp) {
if (Z_TYPE_P(tmp) == IS_OBJECT &&
diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c
index 8d84ccc642..a0d3e132a1 100644
--- a/ext/sockets/multicast.c
+++ b/ext/sockets/multicast.c
@@ -171,7 +171,7 @@ static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, zval *
mcast_req_fun = &php_mcast_leave;
mcast_req_fun:
convert_to_array_ex(arg4);
- opt_ht = HASH_OF(arg4);
+ opt_ht = Z_ARRVAL_P(arg4);
if (php_get_address_from_array(opt_ht, "group", php_sock, &group,
&glen) == FAILURE) {
@@ -207,7 +207,7 @@ mcast_req_fun:
mcast_sreq_fun = &php_mcast_leave_source;
mcast_sreq_fun:
convert_to_array_ex(arg4);
- opt_ht = HASH_OF(arg4);
+ opt_ht = Z_ARRVAL_P(arg4);
if (php_get_address_from_array(opt_ht, "group", php_sock, &group,
&glen) == FAILURE) {
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index e1caa19fc5..4385093fe9 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -2035,7 +2035,7 @@ PHP_FUNCTION(socket_set_option)
const char l_linger_key[] = "l_linger";
convert_to_array_ex(arg4);
- opt_ht = HASH_OF(arg4);
+ opt_ht = Z_ARRVAL_P(arg4);
if ((l_onoff = zend_hash_str_find(opt_ht, l_onoff_key, sizeof(l_onoff_key) - 1)) == NULL) {
php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key);
@@ -2063,7 +2063,7 @@ PHP_FUNCTION(socket_set_option)
const char usec_key[] = "usec";
convert_to_array_ex(arg4);
- opt_ht = HASH_OF(arg4);
+ opt_ht = Z_ARRVAL_P(arg4);
if ((sec = zend_hash_str_find(opt_ht, sec_key, sizeof(sec_key) - 1)) == NULL) {
php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", sec_key);
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 68ddd42dda..cd0c624b50 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2318,10 +2318,7 @@ static void spl_dual_it_free_storage(zend_object *_object)
}
if (object->dit_type == DIT_CachingIterator || object->dit_type == DIT_RecursiveCachingIterator) {
- if (Z_TYPE(object->u.caching.zcache) != IS_UNDEF) {
- zval_ptr_dtor(&object->u.caching.zcache);
- //ZVAL_UNDEF(&object->u.caching.zcache);
- }
+ zval_ptr_dtor(&object->u.caching.zcache);
}
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
@@ -2645,7 +2642,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern)
ZVAL_DEREF(data);
Z_TRY_ADDREF_P(data);
- array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, data);
+ array_set_zval_key(Z_ARRVAL(intern->u.caching.zcache), key, data);
zval_ptr_dtor(data);
}
/* Recursion ? */
@@ -2710,7 +2707,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern)
static inline void spl_caching_it_rewind(spl_dual_it_object *intern)
{
spl_dual_it_rewind(intern);
- zend_hash_clean(HASH_OF(&intern->u.caching.zcache));
+ zend_hash_clean(Z_ARRVAL(intern->u.caching.zcache));
spl_caching_it_next(intern);
}
@@ -2831,7 +2828,7 @@ SPL_METHOD(CachingIterator, offsetSet)
if (Z_REFCOUNTED_P(value)) {
Z_ADDREF_P(value);
}
- zend_symtable_update(HASH_OF(&intern->u.caching.zcache), key, value);
+ zend_symtable_update(Z_ARRVAL(intern->u.caching.zcache), key, value);
}
/* }}} */
@@ -2854,7 +2851,7 @@ SPL_METHOD(CachingIterator, offsetGet)
return;
}
- if ((value = zend_symtable_find(HASH_OF(&intern->u.caching.zcache), key)) == NULL) {
+ if ((value = zend_symtable_find(Z_ARRVAL(intern->u.caching.zcache), key)) == NULL) {
zend_error(E_NOTICE, "Undefined index: %s", ZSTR_VAL(key));
return;
}
@@ -2882,7 +2879,7 @@ SPL_METHOD(CachingIterator, offsetUnset)
return;
}
- zend_symtable_del(HASH_OF(&intern->u.caching.zcache), key);
+ zend_symtable_del(Z_ARRVAL(intern->u.caching.zcache), key);
}
/* }}} */
@@ -2904,7 +2901,7 @@ SPL_METHOD(CachingIterator, offsetExists)
return;
}
- RETURN_BOOL(zend_symtable_exists(HASH_OF(&intern->u.caching.zcache), key));
+ RETURN_BOOL(zend_symtable_exists(Z_ARRVAL(intern->u.caching.zcache), key));
}
/* }}} */
@@ -2913,7 +2910,6 @@ SPL_METHOD(CachingIterator, offsetExists)
SPL_METHOD(CachingIterator, getCache)
{
spl_dual_it_object *intern;
- zval *value;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -2926,9 +2922,7 @@ SPL_METHOD(CachingIterator, getCache)
return;
}
- value = &intern->u.caching.zcache;
- ZVAL_DEREF(value);
- ZVAL_COPY(return_value, value);
+ ZVAL_COPY(return_value, &intern->u.caching.zcache);
}
/* }}} */
@@ -2975,7 +2969,7 @@ SPL_METHOD(CachingIterator, setFlags)
}
if ((flags & CIT_FULL_CACHE) != 0 && (intern->u.caching.flags & CIT_FULL_CACHE) == 0) {
/* clear on (re)enable */
- zend_hash_clean(HASH_OF(&intern->u.caching.zcache));
+ zend_hash_clean(Z_ARRVAL(intern->u.caching.zcache));
}
intern->u.caching.flags = (intern->u.caching.flags & ~CIT_PUBLIC) | (flags & CIT_PUBLIC);
}
@@ -2998,7 +2992,7 @@ SPL_METHOD(CachingIterator, count)
return;
}
- RETURN_LONG(zend_hash_num_elements(HASH_OF(&intern->u.caching.zcache)));
+ RETURN_LONG(zend_hash_num_elements(Z_ARRVAL(intern->u.caching.zcache)));
}
/* }}} */
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index ca8bbae35b..16077bcb5b 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4265,7 +4265,7 @@ PHP_FUNCTION(getopt)
* in order to be on the safe side, even though it is also available
* from the symbol table. */
if ((Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY || zend_is_auto_global_str(ZEND_STRL("_SERVER"))) &&
- ((args = zend_hash_str_find_ind(HASH_OF(&PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv")-1)) != NULL ||
+ ((args = zend_hash_str_find_ind(Z_ARRVAL_P(&PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv")-1)) != NULL ||
(args = zend_hash_str_find_ind(&EG(symbol_table), "argv", sizeof("argv")-1)) != NULL)
) {
int pos = 0;
@@ -4379,23 +4379,23 @@ PHP_FUNCTION(getopt)
if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) {
/* numeric string */
int optname_int = atoi(optname);
- if ((args = zend_hash_index_find(HASH_OF(return_value), optname_int)) != NULL) {
+ if ((args = zend_hash_index_find(Z_ARRVAL_P(return_value), optname_int)) != NULL) {
if (Z_TYPE_P(args) != IS_ARRAY) {
convert_to_array_ex(args);
}
- zend_hash_next_index_insert(HASH_OF(args), &val);
+ zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
} else {
- zend_hash_index_update(HASH_OF(return_value), optname_int, &val);
+ zend_hash_index_update(Z_ARRVAL_P(return_value), optname_int, &val);
}
} else {
/* other strings */
- if ((args = zend_hash_str_find(HASH_OF(return_value), optname, strlen(optname))) != NULL) {
+ if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, strlen(optname))) != NULL) {
if (Z_TYPE_P(args) != IS_ARRAY) {
convert_to_array_ex(args);
}
- zend_hash_next_index_insert(HASH_OF(args), &val);
+ zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
} else {
- zend_hash_str_add(HASH_OF(return_value), optname, strlen(optname), &val);
+ zend_hash_str_add(Z_ARRVAL_P(return_value), optname, strlen(optname), &val);
}
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 1c5aed7eb2..f523f9f183 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1617,34 +1617,34 @@ PHP_NAMED_FUNCTION(php_if_fstat)
ZVAL_LONG(&stat_blocks,-1);
#endif
/* Store numeric indexes in proper order */
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_nlink);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_uid);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_gid);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_rdev);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_size);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_atime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_mtime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_ctime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_blksize);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_blocks);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_dev);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_ino);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_mode);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_nlink);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_uid);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_gid);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_rdev);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_size);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_atime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_mtime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_ctime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_blksize);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_blocks);
/* Store string indexes referencing the same zval*/
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0]), &stat_dev);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1]), &stat_ino);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2]), &stat_mode);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3]), &stat_nlink);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4]), &stat_uid);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5]), &stat_gid);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6]), &stat_rdev);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7]), &stat_size);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8]), &stat_atime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9]), &stat_mtime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10]), &stat_ctime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11]), &stat_blksize);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12]), &stat_blocks);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[0], strlen(stat_sb_names[0]), &stat_dev);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[1], strlen(stat_sb_names[1]), &stat_ino);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[2], strlen(stat_sb_names[2]), &stat_mode);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[3], strlen(stat_sb_names[3]), &stat_nlink);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[4], strlen(stat_sb_names[4]), &stat_uid);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[5], strlen(stat_sb_names[5]), &stat_gid);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[6], strlen(stat_sb_names[6]), &stat_rdev);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[7], strlen(stat_sb_names[7]), &stat_size);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[8], strlen(stat_sb_names[8]), &stat_atime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[9], strlen(stat_sb_names[9]), &stat_mtime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[10], strlen(stat_sb_names[10]), &stat_ctime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[11], strlen(stat_sb_names[11]), &stat_blksize);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[12], strlen(stat_sb_names[12]), &stat_blocks);
}
/* }}} */
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 764b490b9a..316a84a927 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -1037,35 +1037,35 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
ZVAL_LONG(&stat_blocks,-1);
#endif
/* Store numeric indexes in proper order */
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_nlink);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_uid);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_gid);
-
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_rdev);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_size);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_atime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_mtime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_ctime);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_blksize);
- zend_hash_next_index_insert(HASH_OF(return_value), &stat_blocks);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_dev);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_ino);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_mode);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_nlink);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_uid);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_gid);
+
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_rdev);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_size);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_atime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_mtime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_ctime);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_blksize);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &stat_blocks);
/* Store string indexes referencing the same zval*/
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0]), &stat_dev);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1]), &stat_ino);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2]), &stat_mode);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3]), &stat_nlink);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4]), &stat_uid);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5]), &stat_gid);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6]), &stat_rdev);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7]), &stat_size);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8]), &stat_atime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9]), &stat_mtime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10]), &stat_ctime);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11]), &stat_blksize);
- zend_hash_str_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12]), &stat_blocks);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[0], strlen(stat_sb_names[0]), &stat_dev);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[1], strlen(stat_sb_names[1]), &stat_ino);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[2], strlen(stat_sb_names[2]), &stat_mode);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[3], strlen(stat_sb_names[3]), &stat_nlink);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[4], strlen(stat_sb_names[4]), &stat_uid);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[5], strlen(stat_sb_names[5]), &stat_gid);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[6], strlen(stat_sb_names[6]), &stat_rdev);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[7], strlen(stat_sb_names[7]), &stat_size);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[8], strlen(stat_sb_names[8]), &stat_atime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[9], strlen(stat_sb_names[9]), &stat_mtime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[10], strlen(stat_sb_names[10]), &stat_ctime);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[11], strlen(stat_sb_names[11]), &stat_blksize);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), stat_sb_names[12], strlen(stat_sb_names[12]), &stat_blocks);
return;
}
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 447cbbcc6e..eb47b37c2d 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -101,7 +101,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent
return env;
}
- target_hash = HASH_OF(environment);
+ target_hash = Z_ARRVAL_P(environment);
if (!target_hash) {
return env;
}
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 9c1031effb..7e1408af69 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -3453,7 +3453,7 @@ PHP_FUNCTION(strtr)
}
if (ac == 2) {
- HashTable *pats = HASH_OF(from);
+ HashTable *pats = Z_ARRVAL_P(from);
if (zend_hash_num_elements(pats) < 1) {
RETURN_STR_COPY(str);
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 2531a0ff9a..1c9e9a6e4c 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -767,7 +767,7 @@ no_name_header:
s++;
}
- if ((prev_val = zend_hash_str_find(HASH_OF(return_value), Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr)))) == NULL) {
+ if ((prev_val = zend_hash_str_find(Z_ARRVAL_P(return_value), Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr)))) == NULL) {
add_assoc_stringl_ex(return_value, Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr)), s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr))));
} else { /* some headers may occur more than once, therefor we need to remake the string into an array */
convert_to_array(prev_val);
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index cc76f165ac..56e3742fed 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -70,7 +70,7 @@
#define TIDY_APPLY_CONFIG_ZVAL(_doc, _val) \
if(_val) { \
if(Z_TYPE_P(_val) == IS_ARRAY) { \
- _php_tidy_apply_config_array(_doc, HASH_OF(_val)); \
+ _php_tidy_apply_config_array(_doc, Z_ARRVAL_P(_val)); \
} else { \
convert_to_string_ex(_val); \
TIDY_OPEN_BASE_DIR_CHECK(Z_STRVAL_P(_val)); \
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 693ccef7b1..d719be9d1e 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -463,7 +463,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
PHP_CLEANUP_CLASS_ATTRIBUTES();
- objhash = HASH_OF(obj);
+ objhash = Z_OBJPROP_P(obj);
ZEND_HASH_FOREACH_VAL(sleephash, varname) {
if (Z_TYPE_P(varname) != IS_STRING) {
@@ -493,7 +493,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
PHP_CLEANUP_CLASS_ATTRIBUTES();
- objhash = HASH_OF(obj);
+ objhash = Z_OBJPROP_P(obj);
ZEND_HASH_FOREACH_KEY_VAL(objhash, idx, key, ent) {
if (ent == obj) {
continue;
@@ -533,7 +533,7 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
char tmp_buf[WDDX_BUF_LEN];
zend_ulong ind = 0;
- target_hash = HASH_OF(arr);
+ target_hash = Z_ARRVAL_P(arr);
ZEND_HASH_FOREACH_KEY(target_hash, idx, key) {
if (key) {
is_struct = 1;
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index f68534c48d..0e0d5db725 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -314,12 +314,12 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char **remove_path, size_t *remove_path_len, char **add_path, size_t *add_path_len) /* {{{ */
{
zval *option;
- if ((option = zend_hash_str_find(HASH_OF(options), "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) {
+ if ((option = zend_hash_str_find(Z_ARRVAL_P(options), "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) {
*remove_all_path = zval_get_long(option);
}
/* If I add more options, it would make sense to create a nice static struct and loop over it. */
- if ((option = zend_hash_str_find(HASH_OF(options), "remove_path", sizeof("remove_path") - 1)) != NULL) {
+ if ((option = zend_hash_str_find(Z_ARRVAL_P(options), "remove_path", sizeof("remove_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_STRING) {
php_error_docref(NULL, E_WARNING, "remove_path option expected to be a string");
return -1;
@@ -339,7 +339,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
*remove_path = Z_STRVAL_P(option);
}
- if ((option = zend_hash_str_find(HASH_OF(options), "add_path", sizeof("add_path") - 1)) != NULL) {
+ if ((option = zend_hash_str_find(Z_ARRVAL_P(options), "add_path", sizeof("add_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_STRING) {
php_error_docref(NULL, E_WARNING, "add_path option expected to be a string");
return -1;