summaryrefslogtreecommitdiff
path: root/ext/soap/php_encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r--ext/soap/php_encoding.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 897956d91..5cec3e558 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -2313,10 +2313,6 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
zend_object_iterator *iter;
zend_class_entry *ce = Z_OBJCE_P(data);
zval **val;
- char *str_key;
- uint str_key_len;
- ulong int_key;
- int key_type;
ALLOC_ZVAL(array_copy);
INIT_PZVAL(array_copy);
@@ -2345,19 +2341,14 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
goto iterator_done;
}
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
if (EG(exception)) {
goto iterator_done;
}
- switch(key_type) {
- case HASH_KEY_IS_STRING:
- add_assoc_zval_ex(array_copy, str_key, str_key_len, *val);
- efree(str_key);
- break;
- case HASH_KEY_IS_LONG:
- add_index_zval(array_copy, int_key, *val);
- break;
- }
+ array_set_zval_key(Z_ARRVAL_P(array_copy), &key, *val);
+ zval_ptr_dtor(val);
+ zval_dtor(&key);
} else {
add_next_index_zval(array_copy, *val);
}