summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2008-02-02 13:56:59 +0000
committerMarcus Boerger <helly@php.net>2008-02-02 13:56:59 +0000
commit95a3cccf5f1259eb1d8c225e7e1e4f06f6cc74d7 (patch)
tree70906df92112c82f336eee0d8b43ae5bf2d64f61 /Zend/zend_API.c
parent30eb2dcabf823b0fd48e6a513a95e7bc479616eb (diff)
downloadphp-git-95a3cccf5f1259eb1d8c225e7e1e4f06f6cc74d7.tar.gz
- Fix flag handling in message generation
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 503ea5fde3..bfec867576 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2400,21 +2400,30 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze
*fptr_ptr = fptr;
if (*ce_ptr) {
if (!*zobj_ptr_ptr && !(fptr->common.fn_flags & ZEND_ACC_STATIC)) {
+ int severity;
+ char *verb;
+ if (fptr->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ severity = E_STRICT;
+ verb = "should not";
+ } else {
+ severity = E_ERROR;
+ verb = "cannot";
+ }
if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) {
retval = 0;
}
if (EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), *ce_ptr TSRMLS_CC)) {
*zobj_ptr_ptr = &EG(This);
if (error) {
- zend_spprintf(error, 0, "non-static method %s::%s() cannot be called statically, assuming $this from compatible context %s", (*ce_ptr)->name, fptr->common.function_name, Z_OBJCE_P(EG(This))->name);
+ zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", (*ce_ptr)->name, fptr->common.function_name, verb, Z_OBJCE_P(EG(This))->name);
} else if (retval) {
- zend_error(E_STRICT, "Non-static method %s::%s() cannot be called statically, assuming $this from compatible context %s", (*ce_ptr)->name, fptr->common.function_name, Z_OBJCE_P(EG(This))->name);
+ zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", (*ce_ptr)->name, fptr->common.function_name, verb, Z_OBJCE_P(EG(This))->name);
}
} else {
if (error) {
- zend_spprintf(error, 0, "non-static method %s::%s() should not be called statically", (*ce_ptr)->name, fptr->common.function_name);
+ zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically", (*ce_ptr)->name, fptr->common.function_name, verb);
} else if (retval) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", (*ce_ptr)->name, fptr->common.function_name);
+ zend_error(severity, "Non-static method %s::%s() %s be called statically", (*ce_ptr)->name, fptr->common.function_name, verb);
}
}
}