Skip to content

Commit e93bbf4

Browse files
committed
Remove more leftovers from invalid static calls
Callbacks are now always valid or not valid, there is no in-between.
1 parent c88e2cc commit e93bbf4

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

Zend/zend_API.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, cha
315315
}
316316
/* }}} */
317317

318-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_deprecated(int num, char *error) /* {{{ */
319-
{
320-
const char *space;
321-
const char *class_name = get_active_class_name(&space);
322-
323-
zend_error(E_DEPRECATED, "%s%s%s() expects parameter %d to be a valid callback, %s",
324-
class_name, space, get_active_function_name(), num, error);
325-
efree(error);
326-
}
327-
/* }}} */
328-
329318
ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, int num, int check_null) /* {{{ */
330319
{
331320
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
557546
}
558547
/* }}} */
559548

560-
static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, const char **spec, char **error, int *severity) /* {{{ */
549+
static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, const char **spec, char **error) /* {{{ */
561550
{
562551
const char *spec_walk = *spec;
563552
char c = *spec_walk++;
@@ -773,7 +762,6 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
773762
}
774763

775764
if (is_callable_error) {
776-
*severity = E_ERROR;
777765
zend_spprintf(error, 0, "to be a valid callback, %s", is_callable_error);
778766
efree(is_callable_error);
779767
return "";
@@ -807,9 +795,8 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec
807795
{
808796
const char *expected_type = NULL;
809797
char *error = NULL;
810-
int severity = 0;
811798

812-
expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity);
799+
expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error);
813800
if (expected_type) {
814801
if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) {
815802
const char *space;
@@ -828,9 +815,7 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec
828815
zend_zval_type_name(arg));
829816
}
830817
}
831-
if (severity != E_DEPRECATED) {
832-
return FAILURE;
833-
}
818+
return FAILURE;
834819
}
835820

836821
return SUCCESS;

Zend/zend_API.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception(int nu
951951
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, char *name, zval *arg);
952952
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception(int num, char *name, zval *arg);
953953
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error);
954-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_deprecated(int num, char *error);
955954
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, char *error);
956955

957956
#define ZPP_ERROR_OK 0
@@ -1142,14 +1141,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, cha
11421141
if (!_error) { \
11431142
_expected_type = Z_EXPECTED_FUNC; \
11441143
_error_code = ZPP_ERROR_WRONG_ARG; \
1145-
break; \
11461144
} else { \
11471145
_error_code = ZPP_ERROR_WRONG_CALLBACK; \
1148-
break; \
11491146
} \
1150-
} else if (UNEXPECTED(_error != NULL)) { \
1151-
zend_wrong_callback_deprecated(_i, _error); \
1152-
}
1147+
break; \
1148+
} \
11531149

11541150
#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, separate) \
11551151
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, separate, separate)

0 commit comments

Comments
 (0)