diff options
-rw-r--r-- | Zend/zend_API.h | 3 | ||||
-rw-r--r-- | Zend/zend_builtin_functions.c | 20 | ||||
-rw-r--r-- | Zend/zend_exceptions.c | 4 |
3 files changed, 14 insertions, 13 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h index cd5f710473..a3071caae1 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -189,7 +189,8 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS _zend_get_parameters_array(ht, param_count, argument_array TSRMLS_CC) #define zend_get_parameters_array_ex(param_count, argument_array) \ _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC) - +#define zend_parse_parameters_none() \ + zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") /* Parameter parsing API -- andrei */ diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 2085435e08..3f1feda61a 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1182,8 +1182,8 @@ ZEND_FUNCTION(crash) ZEND_FUNCTION(get_included_files) { char *entry; - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); @@ -1394,8 +1394,8 @@ ZEND_FUNCTION(get_declared_classes) zend_uint mask = ZEND_ACC_INTERFACE; zend_uint comply = 0; - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); @@ -1410,8 +1410,8 @@ ZEND_FUNCTION(get_declared_interfaces) zend_uint mask = ZEND_ACC_INTERFACE; zend_uint comply = 1; - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); @@ -1446,8 +1446,8 @@ ZEND_FUNCTION(get_defined_functions) zval *internal; zval *user; - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } MAKE_STD_ZVAL(internal); @@ -1763,8 +1763,8 @@ ZEND_FUNCTION(debug_print_backtrace) zval *arg_array = NULL; int indent = 0; - if (ZEND_NUM_ARGS()) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } ptr = EG(current_execute_data); diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 15eb21433f..18e3047540 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -182,8 +182,8 @@ ZEND_METHOD(error_exception, __construct) /* }}} */ #define DEFAULT_0_PARAMS \ - if (ZEND_NUM_ARGS() > 0) { \ - ZEND_WRONG_PARAM_COUNT(); \ + if (zend_parse_parameters_none() == FAILURE) { \ + return; \ } static void _default_exception_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) /* {{{ */ |