Skip to content

Commit 2d212b4

Browse files
committed
Drop duplicate arg from hash_get_current_key_ex
1 parent 3d12fc7 commit 2d212b4

File tree

20 files changed

+45
-58
lines changed

20 files changed

+45
-58
lines changed

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ ZEND_FUNCTION(each)
651651
zend_hash_str_add_new(Z_ARRVAL_P(return_value), "value", sizeof("value")-1, entry);
652652

653653
/* add the key elements */
654-
if (zend_hash_get_current_key(target_hash, &key, &num_key, 0) == HASH_KEY_IS_STRING) {
654+
if (zend_hash_get_current_key(target_hash, &key, &num_key) == HASH_KEY_IS_STRING) {
655655
ZVAL_STR_COPY(&tmp, key);
656656
if (Z_REFCOUNTED(tmp)) Z_ADDREF(tmp);
657657
} else {

Zend/zend_hash.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
16251625

16261626

16271627
/* This function should be made binary safe */
1628-
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, zend_bool duplicate, HashPosition *pos)
1628+
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, HashPosition *pos)
16291629
{
16301630
uint32_t idx = *pos;
16311631
Bucket *p;
@@ -1634,11 +1634,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str
16341634
if (idx != INVALID_IDX) {
16351635
p = ht->arData + idx;
16361636
if (p->key) {
1637-
if (duplicate) {
1638-
*str_index = zend_string_copy(p->key);
1639-
} else {
1640-
*str_index = p->key;
1641-
}
1637+
*str_index = p->key;
16421638
return HASH_KEY_IS_STRING;
16431639
} else {
16441640
*num_index = p->h;

Zend/zend_hash.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ ZEND_API zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h);
163163
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS)
164164
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
165165
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
166-
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, zend_bool duplicate, HashPosition *pos);
166+
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, HashPosition *pos);
167167
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
168168
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
169169
ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos);
@@ -183,8 +183,8 @@ typedef struct _HashPointer {
183183
zend_hash_move_forward_ex(ht, &(ht)->nInternalPointer)
184184
#define zend_hash_move_backwards(ht) \
185185
zend_hash_move_backwards_ex(ht, &(ht)->nInternalPointer)
186-
#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \
187-
zend_hash_get_current_key_ex(ht, str_index, num_index, duplicate, &(ht)->nInternalPointer)
186+
#define zend_hash_get_current_key(ht, str_index, num_index) \
187+
zend_hash_get_current_key_ex(ht, str_index, num_index, &(ht)->nInternalPointer)
188188
#define zend_hash_get_current_key_zval(ht, key) \
189189
zend_hash_get_current_key_zval_ex(ht, key, &(ht)->nInternalPointer)
190190
#define zend_hash_get_current_key_type(ht) \

ext/com_dotnet/com_variant.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
4747
zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
4848
for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
4949

50-
keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, 0, &pos);
50+
keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, &pos);
5151

5252
if (HASH_KEY_IS_STRING == keytype) {
5353
goto bogus;
@@ -74,7 +74,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
7474
if (NULL == (item = zend_hash_get_current_data_ex(HASH_OF(z), &pos))) {
7575
break;
7676
}
77-
zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, 0, &pos);
77+
zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, &pos);
7878
php_com_variant_from_zval(&va[intindex], item, codepage);
7979
}
8080

ext/com_dotnet/com_wrapper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static void generate_dispids(php_dispatchex *disp)
463463
zend_hash_internal_pointer_reset_ex(Z_OBJPROP(disp->object), &pos);
464464
while (HASH_KEY_NON_EXISTENT != (keytype =
465465
zend_hash_get_current_key_ex(Z_OBJPROP(disp->object), &name,
466-
&pid, 0, &pos))) {
466+
&pid, &pos))) {
467467
char namebuf[32];
468468
if (keytype == HASH_KEY_IS_LONG) {
469469
snprintf(namebuf, sizeof(namebuf), ZEND_ULONG_FMT, pid);
@@ -497,7 +497,7 @@ static void generate_dispids(php_dispatchex *disp)
497497
zend_hash_internal_pointer_reset_ex(&Z_OBJCE(disp->object)->function_table, &pos);
498498
while (HASH_KEY_NON_EXISTENT != (keytype =
499499
zend_hash_get_current_key_ex(&Z_OBJCE(disp->object)->function_table,
500-
&name, &pid, 0, &pos))) {
500+
&name, &pid, &pos))) {
501501

502502
char namebuf[32];
503503
if (keytype == HASH_KEY_IS_LONG) {
@@ -601,7 +601,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
601601

602602
zend_hash_internal_pointer_reset_ex(id_to_name, &pos);
603603
while (HASH_KEY_NON_EXISTENT != (keytype =
604-
zend_hash_get_current_key_ex(id_to_name, &name, &pid, 0, &pos))) {
604+
zend_hash_get_current_key_ex(id_to_name, &name, &pid, &pos))) {
605605

606606
if (keytype == HASH_KEY_IS_LONG) {
607607

ext/dom/php_dom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp) /* {{{ *
447447
}
448448

449449
if (zend_hash_get_current_key_ex(prop_handlers, &string_key,
450-
&num_key, 0, &pos) != HASH_KEY_IS_STRING) {
450+
&num_key, &pos) != HASH_KEY_IS_STRING) {
451451
continue;
452452
}
453453

ext/ldap/ldap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
13281328
ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES;
13291329
ldap_mods[i]->mod_type = NULL;
13301330

1331-
if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index, 0) == HASH_KEY_IS_STRING) {
1331+
if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index) == HASH_KEY_IS_STRING) {
13321332
ldap_mods[i]->mod_type = estrndup(attribute->val, attribute->len);
13331333
} else {
13341334
php_error_docref(NULL, E_WARNING, "Unknown attribute in the data");
@@ -1602,7 +1602,7 @@ PHP_FUNCTION(ldap_modify_batch)
16021602

16031603
for (j = 0; j < num_modprops; j++) {
16041604
/* are the keys strings? */
1605-
if (zend_hash_get_current_key(Z_ARRVAL_P(mod), &modkey, &tmpUlong, 0) != HASH_KEY_IS_STRING) {
1605+
if (zend_hash_get_current_key(Z_ARRVAL_P(mod), &modkey, &tmpUlong) != HASH_KEY_IS_STRING) {
16061606
php_error_docref(NULL, E_WARNING, "Each entry of modifications array must be string-indexed");
16071607
RETURN_FALSE;
16081608
}

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn)
570570
zend_ulong num_key;
571571
size_t value_len = strlen(*entry_value);
572572

573-
if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, 0, &pos_value)) {
573+
if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, &pos_value)) {
574574
ca_payload_len += php_mysqlnd_net_store_length_size(s_len);
575575
ca_payload_len += s_len;
576576
ca_payload_len += php_mysqlnd_net_store_length_size(value_len);
@@ -606,7 +606,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn)
606606
unsigned int s_len;
607607
zend_ulong num_key;
608608
size_t value_len = strlen(*entry_value);
609-
if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, 0, &pos_value)) {
609+
if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, &pos_value)) {
610610
/* copy key */
611611
p = php_mysqlnd_net_store_length(p, s_len);
612612
memcpy(p, s_key, s_len);

ext/phar/dirstream.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static size_t phar_dir_read(php_stream *stream, char *buf, size_t count) /* {{{
9797
zend_string *str_key;
9898
zend_ulong unused;
9999

100-
if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(data, &str_key, &unused, 0, &data->nInternalPointer)) {
100+
if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key(data, &str_key, &unused)) {
101101
return 0;
102102
}
103103

@@ -199,7 +199,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */
199199
zend_hash_internal_pointer_reset(manifest);
200200

201201
while (FAILURE != zend_hash_has_more_elements(manifest)) {
202-
if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &str_key, &unused, 0, &manifest->nInternalPointer)) {
202+
if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key(manifest, &str_key, &unused)) {
203203
break;
204204
}
205205

@@ -384,8 +384,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
384384
zend_hash_internal_pointer_reset(&phar->manifest);
385385
while (FAILURE != zend_hash_has_more_elements(&phar->manifest)) {
386386
if (HASH_KEY_NON_EXISTENT !=
387-
zend_hash_get_current_key_ex(
388-
&phar->manifest, &str_key, &unused, 0, &phar->manifest.nInternalPointer)) {
387+
zend_hash_get_current_key(&phar->manifest, &str_key, &unused)) {
389388
if (str_key->len > (uint)i_len && 0 == memcmp(str_key->val, internal_file, i_len)) {
390389
/* directory found */
391390
internal_file = estrndup(internal_file,
@@ -612,7 +611,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
612611

613612
if (!entry->is_deleted) {
614613
for (zend_hash_internal_pointer_reset(&phar->manifest);
615-
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->manifest, &str_key, &unused, 0, &phar->manifest.nInternalPointer);
614+
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->manifest, &str_key, &unused);
616615
zend_hash_move_forward(&phar->manifest)
617616
) {
618617
if (str_key->len > path_len &&
@@ -629,7 +628,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
629628
}
630629

631630
for (zend_hash_internal_pointer_reset(&phar->virtual_dirs);
632-
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->virtual_dirs, &str_key, &unused, 0, &phar->virtual_dirs.nInternalPointer);
631+
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->virtual_dirs, &str_key, &unused);
633632
zend_hash_move_forward(&phar->virtual_dirs)) {
634633

635634
if (str_key->len > path_len &&

ext/phar/phar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha
19601960
zend_ulong unused;
19611961

19621962
for (zend_hash_internal_pointer_reset(&(PHAR_GLOBALS->phar_fname_map));
1963-
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&(PHAR_GLOBALS->phar_fname_map), &str_key, &unused, 0, &PHAR_GLOBALS->phar_fname_map.nInternalPointer);
1963+
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&(PHAR_GLOBALS->phar_fname_map), &str_key, &unused);
19641964
zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map))
19651965
) {
19661966
if (str_key->len > (uint) filename_len) {
@@ -1979,7 +1979,7 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha
19791979

19801980
if (PHAR_G(manifest_cached)) {
19811981
for (zend_hash_internal_pointer_reset(&cached_phars);
1982-
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&cached_phars, &str_key, &unused, 0, &cached_phars.nInternalPointer);
1982+
HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&cached_phars, &str_key, &unused);
19831983
zend_hash_move_forward(&cached_phars)
19841984
) {
19851985
if (str_key->len > (uint) filename_len) {

ext/readline/readline_cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static char *cli_completion_generator_ht(const char *text, int textlen, int *sta
409409
(*state)++;
410410
}
411411
while(zend_hash_has_more_elements(ht) == SUCCESS) {
412-
zend_hash_get_current_key(ht, &name, &number, 0);
412+
zend_hash_get_current_key(ht, &name, &number);
413413
if (!textlen || !strncmp(name->val, text, textlen)) {
414414
if (pData) {
415415
*pData = zend_hash_get_current_data_ptr(ht);

ext/reflection/php_reflection.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,12 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
432432
count = zend_hash_num_elements(&ce->constants_table);
433433
string_printf(str, "%s - Constants [%d] {\n", indent, count);
434434
if (count > 0) {
435-
HashPosition pos;
436-
zval *value;
437435
zend_string *key;
438-
zend_ulong num_index;
439-
440-
zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos);
441-
442-
while ((value = zend_hash_get_current_data_ex(&ce->constants_table, &pos)) != NULL) {
443-
zend_hash_get_current_key_ex(&ce->constants_table, &key, &num_index, 0, &pos);
436+
zval *value;
444437

438+
ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, value) {
445439
_const_string(str, key->val, value, indent);
446-
zend_hash_move_forward_ex(&ce->constants_table, &pos);
447-
}
440+
} ZEND_HASH_FOREACH_END();
448441
}
449442
string_printf(str, "%s }\n", indent);
450443
}
@@ -567,7 +560,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
567560
zend_string *prop_name;
568561
zend_ulong index;
569562

570-
if (zend_hash_get_current_key_ex(properties, &prop_name, &index, 0, &pos) == HASH_KEY_IS_STRING) {
563+
if (zend_hash_get_current_key_ex(properties, &prop_name, &index, &pos) == HASH_KEY_IS_STRING) {
571564
if (prop_name->len && prop_name->val[0]) { /* skip all private and protected properties */
572565
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
573566
count++;
@@ -608,7 +601,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
608601
/* Do not display old-style inherited constructors */
609602
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0
610603
|| mptr->common.scope == ce
611-
|| zend_hash_get_current_key_ex(&ce->function_table, &key, &num_index, 0, &pos) != HASH_KEY_IS_STRING
604+
|| zend_hash_get_current_key_ex(&ce->function_table, &key, &num_index, &pos) != HASH_KEY_IS_STRING
612605
|| zend_binary_strcasecmp(key->val, key->len, mptr->common.function_name->val, len) == 0)
613606
{
614607
zend_function *closure;
@@ -805,7 +798,7 @@ static void _function_closure_string(string *str, zend_function *fptr, char* ind
805798
zend_hash_internal_pointer_reset_ex(static_variables, &pos);
806799
i = 0;
807800
while (i < count) {
808-
zend_hash_get_current_key_ex(static_variables, &key, &num_index, 0, &pos);
801+
zend_hash_get_current_key_ex(static_variables, &key, &num_index, &pos);
809802
string_printf(str, "%s Variable #%d [ $%s ]\n", indent, i++, key->val);
810803
zend_hash_move_forward_ex(static_variables, &pos);
811804
}

ext/soap/php_http.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ int make_http_soap_request(zval *this_ptr,
809809
smart_str_append_const(&soap_headers, "Cookie: ");
810810
for (i = 0; i < n; i++) {
811811
data = zend_hash_get_current_data(Z_ARRVAL_P(cookies));
812-
zend_hash_get_current_key_ex(Z_ARRVAL_P(cookies), &key, NULL, 0, NULL);
812+
zend_hash_get_current_key_ex(Z_ARRVAL_P(cookies), &key, NULL, NULL);
813813

814814
if (Z_TYPE_P(data) == IS_ARRAY) {
815815
zval *value;
@@ -822,9 +822,9 @@ int make_http_soap_request(zval *this_ptr,
822822
((tmp = zend_hash_index_find(Z_ARRVAL_P(data), 2)) == NULL ||
823823
in_domain(phpurl->host,Z_STRVAL_P(tmp))) &&
824824
(use_ssl || (tmp = zend_hash_index_find(Z_ARRVAL_P(data), 3)) == NULL)) {
825-
smart_str_appendl(&soap_headers, key->val, key->len);
825+
smart_str_append(&soap_headers, key);
826826
smart_str_appendc(&soap_headers, '=');
827-
smart_str_appendl(&soap_headers, Z_STRVAL_P(value), Z_STRLEN_P(value));
827+
smart_str_append(&soap_headers, Z_STR_P(value));
828828
smart_str_appendc(&soap_headers, ';');
829829
}
830830
}

ext/soap/php_schema.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,15 +2164,15 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT
21642164
newAttr->extraAttributes = ht;
21652165
}
21662166

2167-
zend_hash_get_current_key_ex(tmp->attributes, &_key, NULL, 0, &tmp->attributes->nInternalPointer);
2167+
zend_hash_get_current_key(tmp->attributes, &_key, NULL);
21682168
zend_hash_add_ptr(ht, _key, newAttr);
21692169

21702170
zend_hash_move_forward(tmp->attributes);
21712171
} else {
21722172
zend_ulong index;
21732173

21742174
schema_attributegroup_fixup(ctx, tmp_attr, ht);
2175-
zend_hash_get_current_key(tmp->attributes, NULL, &index, 0);
2175+
zend_hash_get_current_key(tmp->attributes, NULL, &index);
21762176
zend_hash_index_del(tmp->attributes, index);
21772177
}
21782178
}

ext/spl/spl_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht) /*
972972

973973
if (Z_TYPE(intern->array) == IS_OBJECT) {
974974
do {
975-
if (zend_hash_get_current_key_ex(aht, &string_key, &num_key, 0, &intern->pos) == HASH_KEY_IS_STRING) {
975+
if (zend_hash_get_current_key_ex(aht, &string_key, &num_key, &intern->pos) == HASH_KEY_IS_STRING) {
976976
data = zend_hash_get_current_data_ex(aht, &intern->pos);
977977
if (data && Z_TYPE_P(data) == IS_INDIRECT &&
978978
Z_TYPE_P(data = Z_INDIRECT_P(data)) == IS_UNDEF) {

ext/standard/info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ *
111111
}
112112

113113
zend_hash_internal_pointer_reset_ex(ht, &pos);
114-
while (zend_hash_get_current_key_ex(ht, &key, NULL, 0, &pos) == HASH_KEY_IS_STRING)
114+
while (zend_hash_get_current_key_ex(ht, &key, NULL, &pos) == HASH_KEY_IS_STRING)
115115
{
116116
if (!sapi_module.phpinfo_as_text) {
117117
php_info_print_html_esc(key->val, key->len);
118118
} else {
119119
php_info_print(key->val);
120120
}
121121
zend_hash_move_forward_ex(ht, &pos);
122-
if (zend_hash_get_current_key_ex(ht, &key, NULL, 0, &pos) == HASH_KEY_IS_STRING) {
122+
if (zend_hash_get_current_key_ex(ht, &key, NULL, &pos) == HASH_KEY_IS_STRING) {
123123
php_info_print(", ");
124124
} else {
125125
break;

main/php_ini.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int
782782

783783
/* Walk through config hash and alter matching ini entries using the values found in the hash */
784784
for (zend_hash_internal_pointer_reset(source_hash);
785-
zend_hash_get_current_key(source_hash, &str, &num_index, 0) == HASH_KEY_IS_STRING;
785+
zend_hash_get_current_key(source_hash, &str, &num_index) == HASH_KEY_IS_STRING;
786786
zend_hash_move_forward(source_hash)
787787
) {
788788
data = zend_hash_get_current_data(source_hash);

sapi/apache2filter/apache_config.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
132132

133133
phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n));
134134
for (zend_hash_internal_pointer_reset(&d->config);
135-
zend_hash_get_current_key_ex(&d->config, &str, &str_len,
136-
&num_index, 0, NULL) == HASH_KEY_IS_STRING;
135+
zend_hash_get_current_key(&d->config, &str, &str_len,
136+
&num_index) == HASH_KEY_IS_STRING;
137137
zend_hash_move_forward(&d->config)) {
138138
pe = NULL;
139139
zend_hash_get_current_data(&d->config, (void **) &data);
@@ -167,8 +167,7 @@ void apply_config(void *dummy)
167167
php_dir_entry *data;
168168

169169
for (zend_hash_internal_pointer_reset(&d->config);
170-
zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0,
171-
NULL) == HASH_KEY_IS_STRING;
170+
zend_hash_get_current_key(&d->config, &str, &str_len, NULL) == HASH_KEY_IS_STRING;
172171
zend_hash_move_forward(&d->config)) {
173172
zend_hash_get_current_data(&d->config, (void **) &data);
174173
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));

sapi/apache2handler/apache_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
157157
//??? zend_hash_merge_ex(&n->config, &e->config, NULL, sizeof(php_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL);
158158
#if STAS_0
159159
for (zend_hash_internal_pointer_reset(&d->config);
160-
zend_hash_get_current_key_ex(&d->config, &str, &str_len,
161-
&num_index, 0, NULL) == HASH_KEY_IS_STRING;
160+
zend_hash_get_current_key(&d->config, &str, &str_len,
161+
&num_index) == HASH_KEY_IS_STRING;
162162
zend_hash_move_forward(&d->config)) {
163163
pe = NULL;
164164
zend_hash_get_current_data(&d->config, (void **) &data);

sapi/apache_hooks/php_apache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
594594
case 3:
595595
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(first), &pos);
596596
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(first), (void **)&entry, &pos) == SUCCESS) {
597-
switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, 0, &pos)) {
597+
switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, &pos)) {
598598
case HASH_KEY_IS_STRING:
599599
if (zend_hash_find(Z_ARRVAL_P(first), string_key, string_key_len, (void **)&value) == FAILURE) {
600600
zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos);

0 commit comments

Comments
 (0)