@@ -5649,9 +5649,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
5649
5649
SAVE_OPLINE();
5650
5650
function_name = EX_CONSTANT(opline->op2);
5651
5651
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
5652
- if (error) {
5653
- efree(error);
5654
- }
5655
5652
func = fcc.function_handler;
5656
5653
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
5657
5654
/* Delay closure destruction until its invocation */
@@ -5667,20 +5664,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
5667
5664
if (object) {
5668
5665
call_info |= ZEND_CALL_RELEASE_THIS;
5669
5666
GC_REFCOUNT(object)++; /* For $this pointer */
5670
- } else if (func->common.scope &&
5671
- !(func->common.fn_flags & ZEND_ACC_STATIC)) {
5672
- if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
5673
- zend_error(E_DEPRECATED,
5667
+ }
5668
+ if (error) {
5669
+ efree(error);
5670
+ /* This is the only soft error is_callable() can generate */
5671
+ zend_error(E_DEPRECATED,
5674
5672
"Non-static method %s::%s() should not be called statically",
5675
5673
func->common.scope->name->val, func->common.function_name->val);
5676
- } else {
5677
- zend_error(
5678
- E_EXCEPTION | E_ERROR,
5679
- "Non-static method %s::%s() cannot be called statically",
5680
- func->common.scope->name->val, func->common.function_name->val);
5681
-
5682
- HANDLE_EXCEPTION();
5683
- }
5684
5674
}
5685
5675
} else {
5686
5676
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
@@ -9296,9 +9286,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
9296
9286
SAVE_OPLINE();
9297
9287
function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
9298
9288
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
9299
- if (error) {
9300
- efree(error);
9301
- }
9302
9289
func = fcc.function_handler;
9303
9290
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
9304
9291
/* Delay closure destruction until its invocation */
@@ -9314,20 +9301,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
9314
9301
if (object) {
9315
9302
call_info |= ZEND_CALL_RELEASE_THIS;
9316
9303
GC_REFCOUNT(object)++; /* For $this pointer */
9317
- } else if (func->common.scope &&
9318
- !(func->common.fn_flags & ZEND_ACC_STATIC)) {
9319
- if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
9320
- zend_error(E_DEPRECATED,
9304
+ }
9305
+ if (error) {
9306
+ efree(error);
9307
+ /* This is the only soft error is_callable() can generate */
9308
+ zend_error(E_DEPRECATED,
9321
9309
"Non-static method %s::%s() should not be called statically",
9322
9310
func->common.scope->name->val, func->common.function_name->val);
9323
- } else {
9324
- zend_error(
9325
- E_EXCEPTION | E_ERROR,
9326
- "Non-static method %s::%s() cannot be called statically",
9327
- func->common.scope->name->val, func->common.function_name->val);
9328
-
9329
- HANDLE_EXCEPTION();
9330
- }
9331
9311
}
9332
9312
} else {
9333
9313
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
@@ -11032,9 +11012,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
11032
11012
SAVE_OPLINE();
11033
11013
function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
11034
11014
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
11035
- if (error) {
11036
- efree(error);
11037
- }
11038
11015
func = fcc.function_handler;
11039
11016
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
11040
11017
/* Delay closure destruction until its invocation */
@@ -11050,20 +11027,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
11050
11027
if (object) {
11051
11028
call_info |= ZEND_CALL_RELEASE_THIS;
11052
11029
GC_REFCOUNT(object)++; /* For $this pointer */
11053
- } else if (func->common.scope &&
11054
- !(func->common.fn_flags & ZEND_ACC_STATIC)) {
11055
- if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
11056
- zend_error(E_DEPRECATED,
11030
+ }
11031
+ if (error) {
11032
+ efree(error);
11033
+ /* This is the only soft error is_callable() can generate */
11034
+ zend_error(E_DEPRECATED,
11057
11035
"Non-static method %s::%s() should not be called statically",
11058
11036
func->common.scope->name->val, func->common.function_name->val);
11059
- } else {
11060
- zend_error(
11061
- E_EXCEPTION | E_ERROR,
11062
- "Non-static method %s::%s() cannot be called statically",
11063
- func->common.scope->name->val, func->common.function_name->val);
11064
- zval_ptr_dtor_nogc(free_op2);
11065
- HANDLE_EXCEPTION();
11066
- }
11067
11037
}
11068
11038
} else {
11069
11039
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
0 commit comments