summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-04-01 11:42:05 +0200
committerNikita Popov <nikic@php.net>2015-04-01 11:42:05 +0200
commit085774997b591c2babbb623fe7102ce2c77bc9fb (patch)
tree5f3e95ed96b203ffdf7c2eff0cfd3e6c5b4208be /Zend/zend_API.c
parent7c67727082e6629786c41fbe674f7faf6904d8be (diff)
downloadphp-git-085774997b591c2babbb623fe7102ce2c77bc9fb.tar.gz
Drop support for static calls from incompatible context
Implemented by NULLing $this.
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c24
1 files changed, 6 insertions, 18 deletions
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) {