from_idx = len_idx = repl_idx = 0;
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(str), num_index, str_index, tmp_str) {
+ ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(str), num_index, str_index, tmp_str) {
zend_string *tmp_orig_str;
zend_string *orig_str = zval_get_tmp_string(tmp_str, &tmp_orig_str);
zend_string *key_used;
/* we have to rebuild HashTable with numeric keys */
zend_hash_init(&str_hash, zend_hash_num_elements(pats), NULL, NULL, 0);
- ZEND_HASH_FOREACH_KEY_VAL(pats, num_key, str_key, entry) {
+ ZEND_HASH_FOREACH_KEY_VAL_IND(pats, num_key, str_key, entry) {
if (UNEXPECTED(!str_key)) {
key_used = zend_long_to_str(num_key);
len = ZSTR_LEN(key_used);
zend_string *str_key, *tmp_str, *replace, *tmp_replace;
zval *entry;
- ZEND_HASH_FOREACH_KEY_VAL(pats, num_key, str_key, entry) {
+ ZEND_HASH_FOREACH_KEY_VAL_IND(pats, num_key, str_key, entry) {
tmp_str = NULL;
if (UNEXPECTED(!str_key)) {
str_key = tmp_str = zend_long_to_str(num_key);
}
/* For each entry in the search array, get the entry */
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(search), search_entry) {
+ ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL_P(search), search_entry) {
/* Make sure we're dealing with strings. */
zend_string *tmp_search_str;
zend_string *search_str = zval_get_tmp_string(search_entry, &tmp_search_str);
/* For each subject entry, convert it to string, then perform replacement
and add the result to the return_value array. */
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) {
+ ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) {
ZVAL_DEREF(subject_entry);
if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) {
count += php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity);