diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index cf0f9bec824..df0e0a8dd7d 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -1148,20 +1148,12 @@ PHP_FUNCTION(wddx_serialize_value) Creates a new packet and serializes given variables into a struct */ PHP_FUNCTION(wddx_serialize_vars) { - int argc, i; + int num_args, i; wddx_packet *packet; - zval ***args; - - argc = ZEND_NUM_ARGS(); - if (argc < 1) { - WRONG_PARAM_COUNT; - } + zval ***args = NULL; - /* Allocate arguments array and get the arguments, checking for errors. */ - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) { + return; } packet = php_wddx_constructor(); @@ -1169,9 +1161,10 @@ PHP_FUNCTION(wddx_serialize_vars) php_wddx_packet_start(packet, NULL, 0); php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - for (i=0; i