diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-30 13:08:35 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-30 13:13:47 +0100 |
commit | e93bbf4d5d2812c698a4711fc0ff751b170bdf2b (patch) | |
tree | ffb32b88b3911e8d77910539f2cf83e749a623fc | |
parent | c88e2cce815a6d2d3fa0e7e8f46fe0fc8de6abe3 (diff) | |
download | php-git-e93bbf4d5d2812c698a4711fc0ff751b170bdf2b.tar.gz |
Remove more leftovers from invalid static calls
Callbacks are now always valid or not valid, there is no in-between.
-rw-r--r-- | Zend/zend_API.c | 21 | ||||
-rw-r--r-- | Zend/zend_API.h | 8 |
2 files changed, 5 insertions, 24 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index db9afa0f4f..e524227156 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -315,17 +315,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, cha } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_deprecated(int num, char *error) /* {{{ */ -{ - const char *space; - const char *class_name = get_active_class_name(&space); - - zend_error(E_DEPRECATED, "%s%s%s() expects parameter %d to be a valid callback, %s", - class_name, space, get_active_function_name(), num, error); - efree(error); -} -/* }}} */ - ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, int num, int check_null) /* {{{ */ { zend_class_entry *ce_base = *pce; @@ -557,7 +546,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest } /* }}} */ -static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, const char **spec, char **error, int *severity) /* {{{ */ +static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, const char **spec, char **error) /* {{{ */ { const char *spec_walk = *spec; char c = *spec_walk++; @@ -773,7 +762,6 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons } if (is_callable_error) { - *severity = E_ERROR; zend_spprintf(error, 0, "to be a valid callback, %s", is_callable_error); efree(is_callable_error); return ""; @@ -807,9 +795,8 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec { const char *expected_type = NULL; char *error = NULL; - int severity = 0; - expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity); + expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error); if (expected_type) { if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) { const char *space; @@ -828,9 +815,7 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec zend_zval_type_name(arg)); } } - if (severity != E_DEPRECATED) { - return FAILURE; - } + return FAILURE; } return SUCCESS; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index c76a919db6..7656c2aee1 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -951,7 +951,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception(int nu ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, char *name, zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception(int num, char *name, zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_deprecated(int num, char *error); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, char *error); #define ZPP_ERROR_OK 0 @@ -1142,14 +1141,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, cha if (!_error) { \ _expected_type = Z_EXPECTED_FUNC; \ _error_code = ZPP_ERROR_WRONG_ARG; \ - break; \ } else { \ _error_code = ZPP_ERROR_WRONG_CALLBACK; \ - break; \ } \ - } else if (UNEXPECTED(_error != NULL)) { \ - zend_wrong_callback_deprecated(_i, _error); \ - } + break; \ + } \ #define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, separate) \ Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, separate, separate) |