From f52edc19a72dcfe53824104a3c752da301814c6e Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Thu, 18 Mar 2004 13:28:05 +0000 Subject: [PATCH] Improve error message - on E_STRICT, method is actually called, so the error shouldn't say it cannot be called. --- Zend/zend_execute.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.50.1