From cd3b070d7eb98119878bfe496d6d2c4748ed550b Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 8 Dec 2013 18:04:39 -0200 Subject: [PATCH] - Added variadic support to prototype dumping --- phpdbg_frame.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/phpdbg_frame.c b/phpdbg_frame.c index 88e2824ea9..5414242e3e 100644 --- a/phpdbg_frame.c +++ b/phpdbg_frame.c @@ -134,22 +134,29 @@ static void phpdbg_dump_prototype(zval **tmp TSRMLS_DC) /* {{{ */ Z_STRVAL_PP(funcname), is_class == FAILURE ? NULL : Z_STRVAL_PP(class) TSRMLS_CC); const zend_arg_info *arginfo = func ? func->common.arg_info : NULL; int j = 0, m = func ? func->common.num_args : 0; + zend_bool is_variadic = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(args), &iterator); while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(args), (void **) &argstmp, &iterator) == SUCCESS) { - if (j) { phpdbg_write(", "); } if (m && j < m) { - phpdbg_write("%s=", arginfo[j].name); +#if PHP_VERSION_ID >= 50600 + is_variadic = arginfo[j].is_variadic; +#endif + phpdbg_write("%s=%s", + arginfo[j].name, is_variadic ? "[": ""); } ++j; zend_print_flat_zval_r(*argstmp TSRMLS_CC); zend_hash_move_forward_ex(Z_ARRVAL_PP(args), &iterator); } + if (is_variadic) { + phpdbg_write("]"); + } } phpdbg_write(")"); } -- 2.50.1