You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just changing the error level of the message from E_STRICT to
E_DEPRECATED. This comes one version later than the timeline
mentioned in the RFC.
Oddly, there were no tests for this ‘feature’. I added a simple
one.
/* We are calling method of the other (incompatible) class,
2610
2610
but passing $this. This is done for compatibility with php-4. */
2611
2611
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);
2613
2613
} else {
2614
2614
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
2615
2615
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);
Copy file name to clipboardExpand all lines: Zend/zend_vm_execute.h
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -3661,7 +3661,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
3661
3661
/* We are calling method of the other (incompatible) class,
3662
3662
but passing $this. This is done for compatibility with php-4. */
3663
3663
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);
3665
3665
} else {
3666
3666
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
3667
3667
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
4654
4654
/* We are calling method of the other (incompatible) class,
4655
4655
but passing $this. This is done for compatibility with php-4. */
4656
4656
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);
4658
4658
} else {
4659
4659
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
4660
4660
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
5512
5512
/* We are calling method of the other (incompatible) class,
5513
5513
but passing $this. This is done for compatibility with php-4. */
5514
5514
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);
5516
5516
} else {
5517
5517
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
5518
5518
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
6232
6232
/* We are calling method of the other (incompatible) class,
6233
6233
but passing $this. This is done for compatibility with php-4. */
6234
6234
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);
6236
6236
} else {
6237
6237
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
6238
6238
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
7092
7092
/* We are calling method of the other (incompatible) class,
7093
7093
but passing $this. This is done for compatibility with php-4. */
7094
7094
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);
7096
7096
} else {
7097
7097
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
7098
7098
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
15561
15561
/* We are calling method of the other (incompatible) class,
15562
15562
but passing $this. This is done for compatibility with php-4. */
15563
15563
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);
15565
15565
} else {
15566
15566
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
15567
15567
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
17914
17914
/* We are calling method of the other (incompatible) class,
17915
17915
but passing $this. This is done for compatibility with php-4. */
17916
17916
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);
17918
17918
} else {
17919
17919
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
17920
17920
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
20227
20227
/* We are calling method of the other (incompatible) class,
20228
20228
but passing $this. This is done for compatibility with php-4. */
20229
20229
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);
20231
20231
} else {
20232
20232
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
20233
20233
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
21667
21667
/* We are calling method of the other (incompatible) class,
21668
21668
but passing $this. This is done for compatibility with php-4. */
21669
21669
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);
21671
21671
} else {
21672
21672
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
21673
21673
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_
23685
23685
/* We are calling method of the other (incompatible) class,
23686
23686
but passing $this. This is done for compatibility with php-4. */
23687
23687
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);
23689
23689
} else {
23690
23690
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
23691
23691
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