-#define FOREACH_VAL(pos, array, val) FOREACH_HASH_VAL(pos, HASH_OF(array), val)
-#define FOREACH_HASH_VAL(pos, hash, val) \
- for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
- zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \
- zend_hash_move_forward_ex(hash, &pos))
-
-#define FOREACH_KEY(pos, array, key) FOREACH_HASH_KEY(pos, HASH_OF(array), key)
-#define FOREACH_HASH_KEY(pos, hash, _key) \
- for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
- ((_key).type = zend_hash_get_current_key_ex(hash, &(_key).str, &(_key).len, &(_key).num, (zend_bool) (_key).dup, &pos)) != HASH_KEY_NON_EXISTANT; \
- zend_hash_move_forward_ex(hash, &pos)) \
-
-#define FOREACH_KEYVAL(pos, array, key, val) FOREACH_HASH_KEYVAL(pos, HASH_OF(array), key, val)
-#define FOREACH_HASH_KEYVAL(pos, hash, _key, val) \
- for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
- ((_key).type = zend_hash_get_current_key_ex(hash, &(_key).str, &(_key).len, &(_key).num, (zend_bool) (_key).dup, &pos)) != HASH_KEY_NON_EXISTANT && \
- zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \
- zend_hash_move_forward_ex(hash, &pos))
-
-#define array_copy(src, dst) zend_hash_copy(dst, src, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *))
-#define ARRAY_JOIN_STRONLY 1
-#define ARRAY_JOIN_PRETTIFY 2
-#define array_join(src, dst, append, flags) zend_hash_apply_with_arguments(src TSRMLS_CC, (append)?php_http_array_apply_append_func:php_http_array_apply_merge_func, 2, dst, (int)flags)
-
-int php_http_array_apply_append_func(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
-int php_http_array_apply_merge_func(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
+#define array_copy(src, dst) zend_hash_copy(dst, src, (copy_ctor_func_t) zval_add_ref)
+#define array_copy_strings(src, dst) zend_hash_copy(dst, src, php_http_array_copy_strings)
+#define ARRAY_JOIN_STRONLY 0x01
+#define ARRAY_JOIN_PRETTIFY 0x02
+#define ARRAY_JOIN_STRINGIFY 0x04
+#define array_join(src, dst, append, flags) zend_hash_apply_with_arguments(src, (append)?php_http_array_apply_append_func:php_http_array_apply_merge_func, 2, dst, (int)flags)
+
+void php_http_array_copy_strings(zval *zp);
+int php_http_array_apply_append_func(zval *pDest, int num_args, va_list args, zend_hash_key *hash_key);
+int php_http_array_apply_merge_func(zval *pDest, int num_args, va_list args, zend_hash_key *hash_key);