From 085774997b591c2babbb623fe7102ce2c77bc9fb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 1 Apr 2015 11:42:05 +0200 Subject: Drop support for static calls from incompatible context Implemented by NULLing $this. --- Zend/zend_API.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'Zend/zend_API.c') diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5a01d546ab..001cb65617 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3108,25 +3108,13 @@ get_function_via_handler: if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) { retval = 0; } - if (EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope)) { - fcc->object = Z_OBJ(EG(current_execute_data)->This); - if (error) { - zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val); - if (severity == E_ERROR) { - retval = 0; - } - } else if (retval) { - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val); - } - } else { - if (error) { - zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb); - if (severity == E_ERROR) { - retval = 0; - } - } else if (retval) { - zend_error(severity, "Non-static method %s::%s() %s be called statically", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb); + if (error) { + zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb); + if (severity == E_ERROR) { + retval = 0; } + } else if (retval) { + zend_error(severity, "Non-static method %s::%s() %s be called statically", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb); } } if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) { -- cgit v1.2.1