}
}
}
- if (fbc->common.scope &&
- !(fbc->common.fn_flags & ZEND_ACC_STATIC) &&
- !object) {
-
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- /* FIXME: output identifiers properly */
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name->val, fbc->common.function_name->val);
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
- }
- } else {
- /* FIXME: output identifiers properly */
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
- }
LOAD_OPLINE();
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
}
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
+ }
} else {
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
}
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
+ }
} else {
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
}
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
+ }
} else {
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
}
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
+ }
} else {
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
object = fcc.object;
if (object) {
GC_REFCOUNT(object)++; /* For $this pointer */
+ } else if (func->common.scope &&
+ !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ }
}
} else {
zend_error(E_WARNING, "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(opline->op1.zv), error);
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
object = fcc.object;
if (object) {
GC_REFCOUNT(object)++; /* For $this pointer */
+ } else if (func->common.scope &&
+ !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ }
}
} else {
zend_error(E_WARNING, "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(opline->op1.zv), error);
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
object = fcc.object;
if (object) {
GC_REFCOUNT(object)++; /* For $this pointer */
+ } else if (func->common.scope &&
+ !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ }
}
} else {
zend_error(E_WARNING, "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(opline->op1.zv), error);
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
object = fcc.object;
if (object) {
GC_REFCOUNT(object)++; /* For $this pointer */
+ } else if (func->common.scope &&
+ !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (func->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_STRICT,
+ "Non-static method %s::%s() should not be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ } else {
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically",
+ func->common.scope->name->val, func->common.function_name->val);
+ }
}
} else {
zend_error(E_WARNING, "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(opline->op1.zv), error);
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}
if (Z_OBJ(EX(This))) {
object = Z_OBJ(EX(This));
GC_REFCOUNT(object)++;
- if (object->handlers->get_class_entry &&
- !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- }
+ }
+ if (!object ||
+ (object->handlers->get_class_entry &&
+ !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(
+ object ? E_DEPRECATED : E_STRICT,
+ "Non-static method %s::%s() should not be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(
+ E_ERROR,
+ "Non-static method %s::%s() cannot be called statically%s",
+ fbc->common.scope->name->val, fbc->common.function_name->val,
+ object ? ", assuming $this from incompatible context" : "");
}
}
}