From: Stanislav Malyshev Date: Thu, 18 Mar 2004 13:28:05 +0000 (+0000) Subject: Improve error message - on E_STRICT, method is actually called, X-Git-Tag: php-5.0.0RC1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f52edc19a72dcfe53824104a3c752da301814c6e;p=php Improve error message - on E_STRICT, method is actually called, so the error shouldn't say it cannot be called. --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 09bdef5c95..eaa575db4d 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2632,12 +2632,15 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS) if (EX(function_state).function->common.scope) { if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { int severity; + char *severity_word; if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { severity = E_STRICT; + severity_word = "should not"; } else { severity = E_ERROR; + severity_word = "cannot"; } - zend_error(severity, "Non-static method %s::%s() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + zend_error(severity, "Non-static method %s::%s() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); } } if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {