@@ -5065,27 +5065,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
5065
5065
5066
5066
object = NULL;
5067
5067
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
5068
- if (Z_OBJ(EX(This))) {
5068
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
5069
5069
object = Z_OBJ(EX(This));
5070
5070
GC_REFCOUNT(object)++;
5071
5071
}
5072
- if (!object ||
5073
- !instanceof_function(object->ce, ce)) {
5074
- /* We are calling method of the other (incompatible) class,
5075
- but passing $this. This is done for compatibility with php-4. */
5072
+ if (!object) {
5076
5073
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
5074
+ /* Allowed for PHP 4 compatibility. */
5077
5075
zend_error(
5078
5076
E_DEPRECATED,
5079
- "Non-static method %s::%s() should not be called statically%s",
5080
- fbc->common.scope->name->val, fbc->common.function_name->val,
5081
- object ? ", assuming $this from incompatible context" : "");
5077
+ "Non-static method %s::%s() should not be called statically",
5078
+ fbc->common.scope->name->val, fbc->common.function_name->val);
5082
5079
} else {
5083
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
5080
+ /* An internal function assumes $this is present and won't check that.
5081
+ * So PHP would crash by allowing the call. */
5084
5082
zend_error(
5085
5083
E_EXCEPTION | E_ERROR,
5086
- "Non-static method %s::%s() cannot be called statically%s",
5087
- fbc->common.scope->name->val, fbc->common.function_name->val,
5088
- object ? ", assuming $this from incompatible context" : "");
5084
+ "Non-static method %s::%s() cannot be called statically",
5085
+ fbc->common.scope->name->val, fbc->common.function_name->val);
5089
5086
HANDLE_EXCEPTION();
5090
5087
}
5091
5088
}
@@ -6989,27 +6986,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
6989
6986
6990
6987
object = NULL;
6991
6988
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
6992
- if (Z_OBJ(EX(This))) {
6989
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
6993
6990
object = Z_OBJ(EX(This));
6994
6991
GC_REFCOUNT(object)++;
6995
6992
}
6996
- if (!object ||
6997
- !instanceof_function(object->ce, ce)) {
6998
- /* We are calling method of the other (incompatible) class,
6999
- but passing $this. This is done for compatibility with php-4. */
6993
+ if (!object) {
7000
6994
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
6995
+ /* Allowed for PHP 4 compatibility. */
7001
6996
zend_error(
7002
6997
E_DEPRECATED,
7003
- "Non-static method %s::%s() should not be called statically%s",
7004
- fbc->common.scope->name->val, fbc->common.function_name->val,
7005
- object ? ", assuming $this from incompatible context" : "");
6998
+ "Non-static method %s::%s() should not be called statically",
6999
+ fbc->common.scope->name->val, fbc->common.function_name->val);
7006
7000
} else {
7007
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
7001
+ /* An internal function assumes $this is present and won't check that.
7002
+ * So PHP would crash by allowing the call. */
7008
7003
zend_error(
7009
7004
E_EXCEPTION | E_ERROR,
7010
- "Non-static method %s::%s() cannot be called statically%s",
7011
- fbc->common.scope->name->val, fbc->common.function_name->val,
7012
- object ? ", assuming $this from incompatible context" : "");
7005
+ "Non-static method %s::%s() cannot be called statically",
7006
+ fbc->common.scope->name->val, fbc->common.function_name->val);
7013
7007
HANDLE_EXCEPTION();
7014
7008
}
7015
7009
}
@@ -8473,27 +8467,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
8473
8467
8474
8468
object = NULL;
8475
8469
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
8476
- if (Z_OBJ(EX(This))) {
8470
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
8477
8471
object = Z_OBJ(EX(This));
8478
8472
GC_REFCOUNT(object)++;
8479
8473
}
8480
- if (!object ||
8481
- !instanceof_function(object->ce, ce)) {
8482
- /* We are calling method of the other (incompatible) class,
8483
- but passing $this. This is done for compatibility with php-4. */
8474
+ if (!object) {
8484
8475
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
8476
+ /* Allowed for PHP 4 compatibility. */
8485
8477
zend_error(
8486
8478
E_DEPRECATED,
8487
- "Non-static method %s::%s() should not be called statically%s",
8488
- fbc->common.scope->name->val, fbc->common.function_name->val,
8489
- object ? ", assuming $this from incompatible context" : "");
8479
+ "Non-static method %s::%s() should not be called statically",
8480
+ fbc->common.scope->name->val, fbc->common.function_name->val);
8490
8481
} else {
8491
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
8482
+ /* An internal function assumes $this is present and won't check that.
8483
+ * So PHP would crash by allowing the call. */
8492
8484
zend_error(
8493
8485
E_EXCEPTION | E_ERROR,
8494
- "Non-static method %s::%s() cannot be called statically%s",
8495
- fbc->common.scope->name->val, fbc->common.function_name->val,
8496
- object ? ", assuming $this from incompatible context" : "");
8486
+ "Non-static method %s::%s() cannot be called statically",
8487
+ fbc->common.scope->name->val, fbc->common.function_name->val);
8497
8488
HANDLE_EXCEPTION();
8498
8489
}
8499
8490
}
@@ -10020,27 +10011,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
10020
10011
10021
10012
object = NULL;
10022
10013
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
10023
- if (Z_OBJ(EX(This))) {
10014
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
10024
10015
object = Z_OBJ(EX(This));
10025
10016
GC_REFCOUNT(object)++;
10026
10017
}
10027
- if (!object ||
10028
- !instanceof_function(object->ce, ce)) {
10029
- /* We are calling method of the other (incompatible) class,
10030
- but passing $this. This is done for compatibility with php-4. */
10018
+ if (!object) {
10031
10019
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
10020
+ /* Allowed for PHP 4 compatibility. */
10032
10021
zend_error(
10033
10022
E_DEPRECATED,
10034
- "Non-static method %s::%s() should not be called statically%s",
10035
- fbc->common.scope->name->val, fbc->common.function_name->val,
10036
- object ? ", assuming $this from incompatible context" : "");
10023
+ "Non-static method %s::%s() should not be called statically",
10024
+ fbc->common.scope->name->val, fbc->common.function_name->val);
10037
10025
} else {
10038
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
10026
+ /* An internal function assumes $this is present and won't check that.
10027
+ * So PHP would crash by allowing the call. */
10039
10028
zend_error(
10040
10029
E_EXCEPTION | E_ERROR,
10041
- "Non-static method %s::%s() cannot be called statically%s",
10042
- fbc->common.scope->name->val, fbc->common.function_name->val,
10043
- object ? ", assuming $this from incompatible context" : "");
10030
+ "Non-static method %s::%s() cannot be called statically",
10031
+ fbc->common.scope->name->val, fbc->common.function_name->val);
10044
10032
HANDLE_EXCEPTION();
10045
10033
}
10046
10034
}
@@ -15880,27 +15868,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
15880
15868
15881
15869
object = NULL;
15882
15870
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
15883
- if (Z_OBJ(EX(This))) {
15871
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
15884
15872
object = Z_OBJ(EX(This));
15885
15873
GC_REFCOUNT(object)++;
15886
15874
}
15887
- if (!object ||
15888
- !instanceof_function(object->ce, ce)) {
15889
- /* We are calling method of the other (incompatible) class,
15890
- but passing $this. This is done for compatibility with php-4. */
15875
+ if (!object) {
15891
15876
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
15877
+ /* Allowed for PHP 4 compatibility. */
15892
15878
zend_error(
15893
15879
E_DEPRECATED,
15894
- "Non-static method %s::%s() should not be called statically%s",
15895
- fbc->common.scope->name->val, fbc->common.function_name->val,
15896
- object ? ", assuming $this from incompatible context" : "");
15880
+ "Non-static method %s::%s() should not be called statically",
15881
+ fbc->common.scope->name->val, fbc->common.function_name->val);
15897
15882
} else {
15898
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
15883
+ /* An internal function assumes $this is present and won't check that.
15884
+ * So PHP would crash by allowing the call. */
15899
15885
zend_error(
15900
15886
E_EXCEPTION | E_ERROR,
15901
- "Non-static method %s::%s() cannot be called statically%s",
15902
- fbc->common.scope->name->val, fbc->common.function_name->val,
15903
- object ? ", assuming $this from incompatible context" : "");
15887
+ "Non-static method %s::%s() cannot be called statically",
15888
+ fbc->common.scope->name->val, fbc->common.function_name->val);
15904
15889
HANDLE_EXCEPTION();
15905
15890
}
15906
15891
}
@@ -17453,27 +17438,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
17453
17438
17454
17439
object = NULL;
17455
17440
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
17456
- if (Z_OBJ(EX(This))) {
17441
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
17457
17442
object = Z_OBJ(EX(This));
17458
17443
GC_REFCOUNT(object)++;
17459
17444
}
17460
- if (!object ||
17461
- !instanceof_function(object->ce, ce)) {
17462
- /* We are calling method of the other (incompatible) class,
17463
- but passing $this. This is done for compatibility with php-4. */
17445
+ if (!object) {
17464
17446
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
17447
+ /* Allowed for PHP 4 compatibility. */
17465
17448
zend_error(
17466
17449
E_DEPRECATED,
17467
- "Non-static method %s::%s() should not be called statically%s",
17468
- fbc->common.scope->name->val, fbc->common.function_name->val,
17469
- object ? ", assuming $this from incompatible context" : "");
17450
+ "Non-static method %s::%s() should not be called statically",
17451
+ fbc->common.scope->name->val, fbc->common.function_name->val);
17470
17452
} else {
17471
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
17453
+ /* An internal function assumes $this is present and won't check that.
17454
+ * So PHP would crash by allowing the call. */
17472
17455
zend_error(
17473
17456
E_EXCEPTION | E_ERROR,
17474
- "Non-static method %s::%s() cannot be called statically%s",
17475
- fbc->common.scope->name->val, fbc->common.function_name->val,
17476
- object ? ", assuming $this from incompatible context" : "");
17457
+ "Non-static method %s::%s() cannot be called statically",
17458
+ fbc->common.scope->name->val, fbc->common.function_name->val);
17477
17459
HANDLE_EXCEPTION();
17478
17460
}
17479
17461
}
@@ -19068,27 +19050,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
19068
19050
19069
19051
object = NULL;
19070
19052
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
19071
- if (Z_OBJ(EX(This))) {
19053
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
19072
19054
object = Z_OBJ(EX(This));
19073
19055
GC_REFCOUNT(object)++;
19074
19056
}
19075
- if (!object ||
19076
- !instanceof_function(object->ce, ce)) {
19077
- /* We are calling method of the other (incompatible) class,
19078
- but passing $this. This is done for compatibility with php-4. */
19057
+ if (!object) {
19079
19058
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
19059
+ /* Allowed for PHP 4 compatibility. */
19080
19060
zend_error(
19081
19061
E_DEPRECATED,
19082
- "Non-static method %s::%s() should not be called statically%s",
19083
- fbc->common.scope->name->val, fbc->common.function_name->val,
19084
- object ? ", assuming $this from incompatible context" : "");
19062
+ "Non-static method %s::%s() should not be called statically",
19063
+ fbc->common.scope->name->val, fbc->common.function_name->val);
19085
19064
} else {
19086
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
19065
+ /* An internal function assumes $this is present and won't check that.
19066
+ * So PHP would crash by allowing the call. */
19087
19067
zend_error(
19088
19068
E_EXCEPTION | E_ERROR,
19089
- "Non-static method %s::%s() cannot be called statically%s",
19090
- fbc->common.scope->name->val, fbc->common.function_name->val,
19091
- object ? ", assuming $this from incompatible context" : "");
19069
+ "Non-static method %s::%s() cannot be called statically",
19070
+ fbc->common.scope->name->val, fbc->common.function_name->val);
19092
19071
HANDLE_EXCEPTION();
19093
19072
}
19094
19073
}
@@ -20625,27 +20604,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
20625
20604
20626
20605
object = NULL;
20627
20606
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
20628
- if (Z_OBJ(EX(This))) {
20607
+ if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce) ) {
20629
20608
object = Z_OBJ(EX(This));
20630
20609
GC_REFCOUNT(object)++;
20631
20610
}
20632
- if (!object ||
20633
- !instanceof_function(object->ce, ce)) {
20634
- /* We are calling method of the other (incompatible) class,
20635
- but passing $this. This is done for compatibility with php-4. */
20611
+ if (!object) {
20636
20612
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
20613
+ /* Allowed for PHP 4 compatibility. */
20637
20614
zend_error(
20638
20615
E_DEPRECATED,
20639
- "Non-static method %s::%s() should not be called statically%s",
20640
- fbc->common.scope->name->val, fbc->common.function_name->val,
20641
- object ? ", assuming $this from incompatible context" : "");
20616
+ "Non-static method %s::%s() should not be called statically",
20617
+ fbc->common.scope->name->val, fbc->common.function_name->val);
20642
20618
} else {
20643
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
20619
+ /* An internal function assumes $this is present and won't check that.
20620
+ * So PHP would crash by allowing the call. */
20644
20621
zend_error(
20645
20622
E_EXCEPTION | E_ERROR,
20646
- "Non-static method %s::%s() cannot be called statically%s",
20647
- fbc->common.scope->name->val, fbc->common.function_name->val,
20648
- object ? ", assuming $this from incompatible context" : "");
20623
+ "Non-static method %s::%s() cannot be called statically",
20624
+ fbc->common.scope->name->val, fbc->common.function_name->val);
20649
20625
HANDLE_EXCEPTION();
20650
20626
}
20651
20627
}
0 commit comments