zend_hash_str_add_new(Z_ARRVAL_P(return_value), "value", sizeof("value")-1, entry);
/* add the key elements */
- if (zend_hash_get_current_key(target_hash, &key, &num_key, 0) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key(target_hash, &key, &num_key) == HASH_KEY_IS_STRING) {
ZVAL_STR_COPY(&tmp, key);
if (Z_REFCOUNTED(tmp)) Z_ADDREF(tmp);
} else {
/* This function should be made binary safe */
-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)
+ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, HashPosition *pos)
{
uint32_t idx = *pos;
Bucket *p;
if (idx != INVALID_IDX) {
p = ht->arData + idx;
if (p->key) {
- if (duplicate) {
- *str_index = zend_string_copy(p->key);
- } else {
- *str_index = p->key;
- }
+ *str_index = p->key;
return HASH_KEY_IS_STRING;
} else {
*num_index = p->h;
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS)
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
-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);
+ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, HashPosition *pos);
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos);
zend_hash_move_forward_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_move_backwards(ht) \
zend_hash_move_backwards_ex(ht, &(ht)->nInternalPointer)
-#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \
- zend_hash_get_current_key_ex(ht, str_index, num_index, duplicate, &(ht)->nInternalPointer)
+#define zend_hash_get_current_key(ht, str_index, num_index) \
+ zend_hash_get_current_key_ex(ht, str_index, num_index, &(ht)->nInternalPointer)
#define zend_hash_get_current_key_zval(ht, key) \
zend_hash_get_current_key_zval_ex(ht, key, &(ht)->nInternalPointer)
#define zend_hash_get_current_key_type(ht) \
zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
- keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, 0, &pos);
+ keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, &pos);
if (HASH_KEY_IS_STRING == keytype) {
goto bogus;
if (NULL == (item = zend_hash_get_current_data_ex(HASH_OF(z), &pos))) {
break;
}
- zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, 0, &pos);
+ zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, &pos);
php_com_variant_from_zval(&va[intindex], item, codepage);
}
zend_hash_internal_pointer_reset_ex(Z_OBJPROP(disp->object), &pos);
while (HASH_KEY_NON_EXISTENT != (keytype =
zend_hash_get_current_key_ex(Z_OBJPROP(disp->object), &name,
- &pid, 0, &pos))) {
+ &pid, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
snprintf(namebuf, sizeof(namebuf), ZEND_ULONG_FMT, pid);
zend_hash_internal_pointer_reset_ex(&Z_OBJCE(disp->object)->function_table, &pos);
while (HASH_KEY_NON_EXISTENT != (keytype =
zend_hash_get_current_key_ex(&Z_OBJCE(disp->object)->function_table,
- &name, &pid, 0, &pos))) {
+ &name, &pid, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
zend_hash_internal_pointer_reset_ex(id_to_name, &pos);
while (HASH_KEY_NON_EXISTENT != (keytype =
- zend_hash_get_current_key_ex(id_to_name, &name, &pid, 0, &pos))) {
+ zend_hash_get_current_key_ex(id_to_name, &name, &pid, &pos))) {
if (keytype == HASH_KEY_IS_LONG) {
}
if (zend_hash_get_current_key_ex(prop_handlers, &string_key,
- &num_key, 0, &pos) != HASH_KEY_IS_STRING) {
+ &num_key, &pos) != HASH_KEY_IS_STRING) {
continue;
}
ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES;
ldap_mods[i]->mod_type = NULL;
- if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index, 0) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index) == HASH_KEY_IS_STRING) {
ldap_mods[i]->mod_type = estrndup(attribute->val, attribute->len);
} else {
php_error_docref(NULL, E_WARNING, "Unknown attribute in the data");
for (j = 0; j < num_modprops; j++) {
/* are the keys strings? */
- if (zend_hash_get_current_key(Z_ARRVAL_P(mod), &modkey, &tmpUlong, 0) != HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key(Z_ARRVAL_P(mod), &modkey, &tmpUlong) != HASH_KEY_IS_STRING) {
php_error_docref(NULL, E_WARNING, "Each entry of modifications array must be string-indexed");
RETURN_FALSE;
}
zend_ulong num_key;
size_t value_len = strlen(*entry_value);
- if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, 0, &pos_value)) {
+ if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, &pos_value)) {
ca_payload_len += php_mysqlnd_net_store_length_size(s_len);
ca_payload_len += s_len;
ca_payload_len += php_mysqlnd_net_store_length_size(value_len);
unsigned int s_len;
zend_ulong num_key;
size_t value_len = strlen(*entry_value);
- if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, 0, &pos_value)) {
+ if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(packet->connect_attr, &s_key, &s_len, &num_key, &pos_value)) {
/* copy key */
p = php_mysqlnd_net_store_length(p, s_len);
memcpy(p, s_key, s_len);
zend_string *str_key;
zend_ulong unused;
- if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(data, &str_key, &unused, 0, &data->nInternalPointer)) {
+ if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key(data, &str_key, &unused)) {
return 0;
}
zend_hash_internal_pointer_reset(manifest);
while (FAILURE != zend_hash_has_more_elements(manifest)) {
- if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &str_key, &unused, 0, &manifest->nInternalPointer)) {
+ if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key(manifest, &str_key, &unused)) {
break;
}
zend_hash_internal_pointer_reset(&phar->manifest);
while (FAILURE != zend_hash_has_more_elements(&phar->manifest)) {
if (HASH_KEY_NON_EXISTENT !=
- zend_hash_get_current_key_ex(
- &phar->manifest, &str_key, &unused, 0, &phar->manifest.nInternalPointer)) {
+ zend_hash_get_current_key(&phar->manifest, &str_key, &unused)) {
if (str_key->len > (uint)i_len && 0 == memcmp(str_key->val, internal_file, i_len)) {
/* directory found */
internal_file = estrndup(internal_file,
if (!entry->is_deleted) {
for (zend_hash_internal_pointer_reset(&phar->manifest);
- HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->manifest, &str_key, &unused, 0, &phar->manifest.nInternalPointer);
+ HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->manifest, &str_key, &unused);
zend_hash_move_forward(&phar->manifest)
) {
if (str_key->len > path_len &&
}
for (zend_hash_internal_pointer_reset(&phar->virtual_dirs);
- HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->virtual_dirs, &str_key, &unused, 0, &phar->virtual_dirs.nInternalPointer);
+ HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->virtual_dirs, &str_key, &unused);
zend_hash_move_forward(&phar->virtual_dirs)) {
if (str_key->len > path_len &&
zend_ulong unused;
for (zend_hash_internal_pointer_reset(&(PHAR_GLOBALS->phar_fname_map));
- 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);
+ HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&(PHAR_GLOBALS->phar_fname_map), &str_key, &unused);
zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map))
) {
if (str_key->len > (uint) filename_len) {
if (PHAR_G(manifest_cached)) {
for (zend_hash_internal_pointer_reset(&cached_phars);
- HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&cached_phars, &str_key, &unused, 0, &cached_phars.nInternalPointer);
+ HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&cached_phars, &str_key, &unused);
zend_hash_move_forward(&cached_phars)
) {
if (str_key->len > (uint) filename_len) {
(*state)++;
}
while(zend_hash_has_more_elements(ht) == SUCCESS) {
- zend_hash_get_current_key(ht, &name, &number, 0);
+ zend_hash_get_current_key(ht, &name, &number);
if (!textlen || !strncmp(name->val, text, textlen)) {
if (pData) {
*pData = zend_hash_get_current_data_ptr(ht);
count = zend_hash_num_elements(&ce->constants_table);
string_printf(str, "%s - Constants [%d] {\n", indent, count);
if (count > 0) {
- HashPosition pos;
- zval *value;
zend_string *key;
- zend_ulong num_index;
-
- zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos);
-
- while ((value = zend_hash_get_current_data_ex(&ce->constants_table, &pos)) != NULL) {
- zend_hash_get_current_key_ex(&ce->constants_table, &key, &num_index, 0, &pos);
+ zval *value;
+ ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, value) {
_const_string(str, key->val, value, indent);
- zend_hash_move_forward_ex(&ce->constants_table, &pos);
- }
+ } ZEND_HASH_FOREACH_END();
}
string_printf(str, "%s }\n", indent);
}
zend_string *prop_name;
zend_ulong index;
- if (zend_hash_get_current_key_ex(properties, &prop_name, &index, 0, &pos) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key_ex(properties, &prop_name, &index, &pos) == HASH_KEY_IS_STRING) {
if (prop_name->len && prop_name->val[0]) { /* skip all private and protected properties */
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
count++;
/* Do not display old-style inherited constructors */
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0
|| mptr->common.scope == ce
- || zend_hash_get_current_key_ex(&ce->function_table, &key, &num_index, 0, &pos) != HASH_KEY_IS_STRING
+ || zend_hash_get_current_key_ex(&ce->function_table, &key, &num_index, &pos) != HASH_KEY_IS_STRING
|| zend_binary_strcasecmp(key->val, key->len, mptr->common.function_name->val, len) == 0)
{
zend_function *closure;
zend_hash_internal_pointer_reset_ex(static_variables, &pos);
i = 0;
while (i < count) {
- zend_hash_get_current_key_ex(static_variables, &key, &num_index, 0, &pos);
+ zend_hash_get_current_key_ex(static_variables, &key, &num_index, &pos);
string_printf(str, "%s Variable #%d [ $%s ]\n", indent, i++, key->val);
zend_hash_move_forward_ex(static_variables, &pos);
}
smart_str_append_const(&soap_headers, "Cookie: ");
for (i = 0; i < n; i++) {
data = zend_hash_get_current_data(Z_ARRVAL_P(cookies));
- zend_hash_get_current_key_ex(Z_ARRVAL_P(cookies), &key, NULL, 0, NULL);
+ zend_hash_get_current_key_ex(Z_ARRVAL_P(cookies), &key, NULL, NULL);
if (Z_TYPE_P(data) == IS_ARRAY) {
zval *value;
((tmp = zend_hash_index_find(Z_ARRVAL_P(data), 2)) == NULL ||
in_domain(phpurl->host,Z_STRVAL_P(tmp))) &&
(use_ssl || (tmp = zend_hash_index_find(Z_ARRVAL_P(data), 3)) == NULL)) {
- smart_str_appendl(&soap_headers, key->val, key->len);
+ smart_str_append(&soap_headers, key);
smart_str_appendc(&soap_headers, '=');
- smart_str_appendl(&soap_headers, Z_STRVAL_P(value), Z_STRLEN_P(value));
+ smart_str_append(&soap_headers, Z_STR_P(value));
smart_str_appendc(&soap_headers, ';');
}
}
newAttr->extraAttributes = ht;
}
- zend_hash_get_current_key_ex(tmp->attributes, &_key, NULL, 0, &tmp->attributes->nInternalPointer);
+ zend_hash_get_current_key(tmp->attributes, &_key, NULL);
zend_hash_add_ptr(ht, _key, newAttr);
zend_hash_move_forward(tmp->attributes);
zend_ulong index;
schema_attributegroup_fixup(ctx, tmp_attr, ht);
- zend_hash_get_current_key(tmp->attributes, NULL, &index, 0);
+ zend_hash_get_current_key(tmp->attributes, NULL, &index);
zend_hash_index_del(tmp->attributes, index);
}
}
if (Z_TYPE(intern->array) == IS_OBJECT) {
do {
- if (zend_hash_get_current_key_ex(aht, &string_key, &num_key, 0, &intern->pos) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key_ex(aht, &string_key, &num_key, &intern->pos) == HASH_KEY_IS_STRING) {
data = zend_hash_get_current_data_ex(aht, &intern->pos);
if (data && Z_TYPE_P(data) == IS_INDIRECT &&
Z_TYPE_P(data = Z_INDIRECT_P(data)) == IS_UNDEF) {
}
zend_hash_internal_pointer_reset_ex(ht, &pos);
- while (zend_hash_get_current_key_ex(ht, &key, NULL, 0, &pos) == HASH_KEY_IS_STRING)
+ while (zend_hash_get_current_key_ex(ht, &key, NULL, &pos) == HASH_KEY_IS_STRING)
{
if (!sapi_module.phpinfo_as_text) {
php_info_print_html_esc(key->val, key->len);
php_info_print(key->val);
}
zend_hash_move_forward_ex(ht, &pos);
- if (zend_hash_get_current_key_ex(ht, &key, NULL, 0, &pos) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key_ex(ht, &key, NULL, &pos) == HASH_KEY_IS_STRING) {
php_info_print(", ");
} else {
break;
/* Walk through config hash and alter matching ini entries using the values found in the hash */
for (zend_hash_internal_pointer_reset(source_hash);
- zend_hash_get_current_key(source_hash, &str, &num_index, 0) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key(source_hash, &str, &num_index) == HASH_KEY_IS_STRING;
zend_hash_move_forward(source_hash)
) {
data = zend_hash_get_current_data(source_hash);
phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n));
for (zend_hash_internal_pointer_reset(&d->config);
- zend_hash_get_current_key_ex(&d->config, &str, &str_len,
- &num_index, 0, NULL) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key(&d->config, &str, &str_len,
+ &num_index) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
pe = NULL;
zend_hash_get_current_data(&d->config, (void **) &data);
php_dir_entry *data;
for (zend_hash_internal_pointer_reset(&d->config);
- zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0,
- NULL) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key(&d->config, &str, &str_len, NULL) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
zend_hash_get_current_data(&d->config, (void **) &data);
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
//??? zend_hash_merge_ex(&n->config, &e->config, NULL, sizeof(php_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL);
#if STAS_0
for (zend_hash_internal_pointer_reset(&d->config);
- zend_hash_get_current_key_ex(&d->config, &str, &str_len,
- &num_index, 0, NULL) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key(&d->config, &str, &str_len,
+ &num_index) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
pe = NULL;
zend_hash_get_current_data(&d->config, (void **) &data);
case 3:
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(first), &pos);
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(first), (void **)&entry, &pos) == SUCCESS) {
- switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, 0, &pos)) {
+ switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, &pos)) {
case HASH_KEY_IS_STRING:
if (zend_hash_find(Z_ARRVAL_P(first), string_key, string_key_len, (void **)&value) == FAILURE) {
zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos);