@@ -244,8 +244,11 @@ ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, cha
244
244
if (severity == E_WARNING ) {
245
245
zend_internal_type_error (ZEND_ARG_USES_STRICT_TYPES (), "%s%s%s() expects parameter %d to be a valid callback, %s" ,
246
246
class_name , space , get_active_function_name (), num , error );
247
+ } else if (severity == E_ERROR ) {
248
+ zend_throw_error (zend_ce_error , "%s%s%s() expects parameter %d to be a valid callback, %s" ,
249
+ class_name , space , get_active_function_name (), num , error );
247
250
} else {
248
- zend_throw_error ( zend_ce_error , severity , "%s%s%s() expects parameter %d to be a valid callback, %s" ,
251
+ zend_error ( severity , "%s%s%s() expects parameter %d to be a valid callback, %s" ,
249
252
class_name , space , get_active_function_name (), num , error );
250
253
}
251
254
efree (error );
@@ -710,7 +713,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
710
713
break ;
711
714
} else {
712
715
if (is_callable_error ) {
713
- * severity = E_EXCEPTION ;
716
+ * severity = E_ERROR ;
714
717
zend_spprintf (error , 0 , "to be a valid callback, %s" , is_callable_error );
715
718
efree (is_callable_error );
716
719
return "" ;
@@ -1273,11 +1276,11 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
1273
1276
{
1274
1277
if (UNEXPECTED (class_type -> ce_flags & (ZEND_ACC_INTERFACE |ZEND_ACC_TRAIT |ZEND_ACC_IMPLICIT_ABSTRACT_CLASS |ZEND_ACC_EXPLICIT_ABSTRACT_CLASS ))) {
1275
1278
if (class_type -> ce_flags & ZEND_ACC_INTERFACE ) {
1276
- zend_throw_error (zend_ce_error , E_EXCEPTION , "Cannot instantiate interface %s" , ZSTR_VAL (class_type -> name ));
1279
+ zend_throw_error (zend_ce_error , "Cannot instantiate interface %s" , ZSTR_VAL (class_type -> name ));
1277
1280
} else if (class_type -> ce_flags & ZEND_ACC_TRAIT ) {
1278
- zend_throw_error (zend_ce_error , E_EXCEPTION , "Cannot instantiate trait %s" , ZSTR_VAL (class_type -> name ));
1281
+ zend_throw_error (zend_ce_error , "Cannot instantiate trait %s" , ZSTR_VAL (class_type -> name ));
1279
1282
} else {
1280
- zend_throw_error (zend_ce_error , E_EXCEPTION , "Cannot instantiate abstract class %s" , ZSTR_VAL (class_type -> name ));
1283
+ zend_throw_error (zend_ce_error , "Cannot instantiate abstract class %s" , ZSTR_VAL (class_type -> name ));
1281
1284
}
1282
1285
ZVAL_NULL (arg );
1283
1286
Z_OBJ_P (arg ) = NULL ;
@@ -3104,7 +3107,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
3104
3107
zend_spprintf (error , 0 , "cannot call abstract method %s::%s()" , ZSTR_VAL (fcc -> calling_scope -> name ), ZSTR_VAL (fcc -> function_handler -> common .function_name ));
3105
3108
retval = 0 ;
3106
3109
} else {
3107
- zend_throw_error (zend_ce_error , E_EXCEPTION , "Cannot call abstract method %s::%s()" , ZSTR_VAL (fcc -> calling_scope -> name ), ZSTR_VAL (fcc -> function_handler -> common .function_name ));
3110
+ zend_throw_error (zend_ce_error , "Cannot call abstract method %s::%s()" , ZSTR_VAL (fcc -> calling_scope -> name ), ZSTR_VAL (fcc -> function_handler -> common .function_name ));
3108
3111
return 0 ;
3109
3112
}
3110
3113
} else if (!fcc -> object && !(fcc -> function_handler -> common .fn_flags & ZEND_ACC_STATIC )) {
@@ -3115,7 +3118,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
3115
3118
verb = "should not" ;
3116
3119
} else {
3117
3120
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
3118
- severity = E_EXCEPTION ;
3121
+ severity = E_ERROR ;
3119
3122
verb = "cannot" ;
3120
3123
}
3121
3124
if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC ) != 0 ) {
@@ -3127,7 +3130,11 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
3127
3130
retval = 0 ;
3128
3131
}
3129
3132
} else if (retval ) {
3130
- zend_throw_error (zend_ce_error , severity , "Non-static method %s::%s() %s be called statically" , ZSTR_VAL (fcc -> calling_scope -> name ), ZSTR_VAL (fcc -> function_handler -> common .function_name ), verb );
3133
+ if (severity == E_ERROR ) {
3134
+ zend_throw_error (zend_ce_error , "Non-static method %s::%s() %s be called statically" , ZSTR_VAL (fcc -> calling_scope -> name ), ZSTR_VAL (fcc -> function_handler -> common .function_name ), verb );
3135
+ } else {
3136
+ zend_error (severity , "Non-static method %s::%s() %s be called statically" , ZSTR_VAL (fcc -> calling_scope -> name ), ZSTR_VAL (fcc -> function_handler -> common .function_name ), verb );
3137
+ }
3131
3138
}
3132
3139
}
3133
3140
if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS ) == 0 ) {
0 commit comments