- zend_hash_index_find(&p->type.conv, PHP_PQ_TYPE_OF_ARRAY(type), (void *) &zconv);
-
- smart_str_appendc(&s, '{');
- zend_hash_apply_with_arguments(Z_ARRVAL_P(zarr) TSRMLS_CC, apply_to_param_from_array, 5, p, &i, &s, (Oid) PHP_PQ_TYPE_OF_ARRAY(type), zconv);
- smart_str_appendc(&s, '}');
+ arg.params = p;
+ arg.buffer = &s;
+ arg.type = PHP_PQ_TYPE_OF_ARRAY(type);
+ arg.delim = PHP_PQ_DELIM_OF_ARRAY(type);
+ zend_hash_index_find(&p->type.conv, PHP_PQ_TYPE_OF_ARRAY(type), (void *) &arg.zconv);
+ smart_str_appendc(arg.buffer, '{');
+ MAKE_STD_ZVAL(zcopy);
+ MAKE_COPY_ZVAL(&zarr, zcopy);
+ zend_hash_apply_with_argument(Z_ARRVAL_P(zcopy), apply_to_param_from_array, &arg TSRMLS_CC);
+ zval_ptr_dtor(&zcopy);
+ smart_str_appendc(arg.buffer, '}');