Skip to content

Commit d532ffa

Browse files
committed
Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src: Typo.... Add a XFAIL test for #64896 Implement phase 1 of rfc/incompat_ctx Make use of direct returns in some places Always pass return_value_ptr to internal functions
2 parents d7ffca5 + 825c1f2 commit d532ffa

12 files changed

+139
-54
lines changed

UPGRADING.INTERNALS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ UPGRADE NOTES - PHP X.Y
44

55
1. Internal API changes
66
a. Addition of do_operation and compare object handlers
7+
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
78

89
2. Build system changes
910
a. Unix build system changes
@@ -43,6 +44,20 @@ UPGRADE NOTES - PHP X.Y
4344

4445
Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp
4546

47+
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
48+
49+
The return_value_ptr argument to internal functions is now always set.
50+
Previously it was only available for functions returning by-reference.
51+
return_value_ptr can now be used to return zvals without copying them.
52+
For this purpose two new macros are provided:
53+
54+
RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
55+
RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */
56+
57+
The macros behave similarly to the non-FAST variants with copy=1 and
58+
dtor=0, but will try to return the zval without making a copy by utilizing
59+
return_value_ptr.
60+
4661
========================
4762
2. Build system changes
4863
========================

Zend/tests/bug64896.phpt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--TEST--
2+
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
3+
--XFAIL--
4+
We can not fix this bug without a significant (performace slow down) change to gc
5+
--FILE--
6+
<?php
7+
$bar = NULL;
8+
class bad
9+
{
10+
private $_private = array();
11+
12+
public function __construct()
13+
{
14+
$this->_private[] = 'php';
15+
}
16+
17+
public function __destruct()
18+
{
19+
global $bar;
20+
$bar = $this;
21+
}
22+
}
23+
24+
$foo = new stdclass;
25+
$foo->foo = $foo;
26+
$foo->bad = new bad;
27+
28+
gc_disable();
29+
30+
unserialize(serialize($foo));
31+
gc_collect_cycles();
32+
var_dump($bar);
33+
/* will output:
34+
object(bad)#4 (1) {
35+
["_private":"bad":private]=>
36+
&UNKNOWN:0
37+
}
38+
*/
39+
?>
40+
--EXPECTF--
41+
bject(bad)#%d (1) {
42+
["_private":"bad":private]=>
43+
array(1) {
44+
[0]=>
45+
string(3) "php"
46+
}
47+
}

Zend/tests/incompat_ctx_user.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Incompatible context call (non-internal function)
3+
--INI--
4+
error_reporting=E_ALL
5+
--FILE--
6+
<?php
7+
8+
class A {
9+
function foo() { var_dump(get_class($this)); }
10+
}
11+
class B {
12+
function bar() { A::foo(); }
13+
}
14+
$b = new B;
15+
$b->bar();
16+
17+
?>
18+
--EXPECTF--
19+
Deprecated: Non-static method A::foo() should not be called statically, assuming $this from incompatible context in %s on line %d
20+
string(1) "B"

Zend/zend_API.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,18 @@ END_EXTERN_C()
636636
#define RETURN_FALSE { RETVAL_FALSE; return; }
637637
#define RETURN_TRUE { RETVAL_TRUE; return; }
638638

639+
#define RETVAL_ZVAL_FAST(z) do { \
640+
zval *_z = (z); \
641+
if (Z_ISREF_P(_z)) { \
642+
RETVAL_ZVAL(_z, 1, 0); \
643+
} else { \
644+
zval_ptr_dtor(&return_value); \
645+
Z_ADDREF_P(_z); \
646+
*return_value_ptr = _z; \
647+
} \
648+
} while (0)
649+
#define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; }
650+
639651
#define SET_VAR_STRING(n, v) { \
640652
{ \
641653
zval *var; \

Zend/zend_closures.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,8 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
5959
} else if (call_user_function_ex(CG(function_table), NULL, this_ptr, &closure_result_ptr, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) {
6060
RETVAL_FALSE;
6161
} else if (closure_result_ptr) {
62-
if (Z_ISREF_P(closure_result_ptr) && return_value_ptr) {
63-
if (return_value) {
64-
zval_ptr_dtor(&return_value);
65-
}
66-
*return_value_ptr = closure_result_ptr;
67-
} else {
68-
RETVAL_ZVAL(closure_result_ptr, 1, 1);
69-
}
62+
zval_ptr_dtor(&return_value);
63+
*return_value_ptr = closure_result_ptr;
7064
}
7165
efree(arguments);
7266

Zend/zend_execute.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,15 +1487,17 @@ ZEND_API opcode_handler_t *zend_opcode_handlers;
14871487

14881488
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC)
14891489
{
1490-
if(fci != NULL) {
1491-
((zend_internal_function *) execute_data_ptr->function_state.function)->handler(fci->param_count,
1492-
*fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
1493-
1490+
if (fci != NULL) {
1491+
execute_data_ptr->function_state.function->internal_function.handler(
1492+
fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr,
1493+
fci->object_ptr, 1 TSRMLS_CC
1494+
);
14941495
} else {
14951496
zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr;
1496-
((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr,
1497-
(execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL,
1498-
execute_data_ptr->object, return_value_used TSRMLS_CC);
1497+
execute_data_ptr->function_state.function->internal_function.handler(
1498+
execute_data_ptr->opline->extended_value, *return_value_ptr, return_value_ptr,
1499+
execute_data_ptr->object, return_value_used TSRMLS_CC
1500+
);
14991501
}
15001502
}
15011503

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
952952
if (EX(function_state).function->common.scope) {
953953
EG(scope) = EX(function_state).function->common.scope;
954954
}
955-
if(EXPECTED(zend_execute_internal == NULL)) {
955+
if (EXPECTED(zend_execute_internal == NULL)) {
956956
/* saves one function call if zend_execute_internal is not used */
957-
((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
957+
EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
958958
} else {
959959
zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC);
960960
}

Zend/zend_generators.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ ZEND_METHOD(Generator, current)
430430
zend_generator_ensure_initialized(generator TSRMLS_CC);
431431

432432
if (generator->value) {
433-
RETURN_ZVAL(generator->value, 1, 0);
433+
RETURN_ZVAL_FAST(generator->value);
434434
}
435435
}
436436
/* }}} */
@@ -450,7 +450,7 @@ ZEND_METHOD(Generator, key)
450450
zend_generator_ensure_initialized(generator TSRMLS_CC);
451451

452452
if (generator->key) {
453-
RETURN_ZVAL(generator->key, 1, 0);
453+
RETURN_ZVAL_FAST(generator->key);
454454
}
455455
}
456456
/* }}} */
@@ -499,7 +499,7 @@ ZEND_METHOD(Generator, send)
499499
zend_generator_resume(generator TSRMLS_CC);
500500

501501
if (generator->value) {
502-
RETURN_ZVAL(generator->value, 1, 0);
502+
RETURN_ZVAL_FAST(generator->value);
503503
}
504504
}
505505
/* }}} */
@@ -532,7 +532,7 @@ ZEND_METHOD(Generator, throw)
532532
zend_generator_resume(generator TSRMLS_CC);
533533

534534
if (generator->value) {
535-
RETURN_ZVAL(generator->value, 1, 0);
535+
RETURN_ZVAL_FAST(generator->value);
536536
}
537537
} else {
538538
/* If the generator is already closed throw the exception in the

Zend/zend_object_handlers.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,8 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
896896
zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr);
897897

898898
if (method_result_ptr) {
899-
if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) {
900-
RETVAL_ZVAL(method_result_ptr, 1, 1);
901-
} else {
902-
RETVAL_ZVAL(method_result_ptr, 0, 1);
903-
}
899+
RETVAL_ZVAL_FAST(method_result_ptr);
900+
zval_ptr_dtor(&method_result_ptr);
904901
}
905902

906903
/* now destruct all auxiliaries */
@@ -1113,11 +1110,8 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{
11131110
zend_call_method_with_2_params(NULL, ce, &ce->__callstatic, ZEND_CALLSTATIC_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr);
11141111

11151112
if (method_result_ptr) {
1116-
if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) {
1117-
RETVAL_ZVAL(method_result_ptr, 1, 1);
1118-
} else {
1119-
RETVAL_ZVAL(method_result_ptr, 0, 1);
1120-
}
1113+
RETVAL_ZVAL_FAST(method_result_ptr);
1114+
zval_ptr_dtor(&method_result_ptr);
11211115
}
11221116

11231117
/* now destruct all auxiliaries */

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
19901990

19911991
if (!zend_execute_internal) {
19921992
/* saves one function call if zend_execute_internal is not used */
1993-
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
1993+
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
19941994
} else {
19951995
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
19961996
}
@@ -2609,7 +2609,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
26092609
/* We are calling method of the other (incompatible) class,
26102610
but passing $this. This is done for compatibility with php-4. */
26112611
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
2612-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
2612+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
26132613
} else {
26142614
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
26152615
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);

Zend/zend_vm_execute.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
551551

552552
if (!zend_execute_internal) {
553553
/* saves one function call if zend_execute_internal is not used */
554-
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
554+
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
555555
} else {
556556
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
557557
}
@@ -3661,7 +3661,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
36613661
/* We are calling method of the other (incompatible) class,
36623662
but passing $this. This is done for compatibility with php-4. */
36633663
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
3664-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
3664+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
36653665
} else {
36663666
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
36673667
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -4654,7 +4654,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
46544654
/* We are calling method of the other (incompatible) class,
46554655
but passing $this. This is done for compatibility with php-4. */
46564656
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
4657-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
4657+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
46584658
} else {
46594659
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
46604660
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -5512,7 +5512,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
55125512
/* We are calling method of the other (incompatible) class,
55135513
but passing $this. This is done for compatibility with php-4. */
55145514
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
5515-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
5515+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
55165516
} else {
55175517
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
55185518
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -6232,7 +6232,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
62326232
/* We are calling method of the other (incompatible) class,
62336233
but passing $this. This is done for compatibility with php-4. */
62346234
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
6235-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
6235+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
62366236
} else {
62376237
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
62386238
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -7092,7 +7092,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
70927092
/* We are calling method of the other (incompatible) class,
70937093
but passing $this. This is done for compatibility with php-4. */
70947094
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
7095-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
7095+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
70967096
} else {
70977097
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
70987098
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -15561,7 +15561,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
1556115561
/* We are calling method of the other (incompatible) class,
1556215562
but passing $this. This is done for compatibility with php-4. */
1556315563
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
15564-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
15564+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
1556515565
} else {
1556615566
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1556715567
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -17914,7 +17914,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
1791417914
/* We are calling method of the other (incompatible) class,
1791517915
but passing $this. This is done for compatibility with php-4. */
1791617916
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
17917-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
17917+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
1791817918
} else {
1791917919
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1792017920
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -20227,7 +20227,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
2022720227
/* We are calling method of the other (incompatible) class,
2022820228
but passing $this. This is done for compatibility with php-4. */
2022920229
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
20230-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
20230+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
2023120231
} else {
2023220232
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
2023320233
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -21667,7 +21667,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
2166721667
/* We are calling method of the other (incompatible) class,
2166821668
but passing $this. This is done for compatibility with php-4. */
2166921669
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
21670-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
21670+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
2167121671
} else {
2167221672
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
2167321673
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -23685,7 +23685,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
2368523685
/* We are calling method of the other (incompatible) class,
2368623686
but passing $this. This is done for compatibility with php-4. */
2368723687
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
23688-
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
23688+
zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
2368923689
} else {
2369023690
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
2369123691
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);

0 commit comments

Comments
 (0)