diff options
| author | Stanislav Malyshev <stas@php.net> | 2004-03-18 13:28:05 +0000 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2004-03-18 13:28:05 +0000 |
| commit | f52edc19a72dcfe53824104a3c752da301814c6e (patch) | |
| tree | 0bb7492a285e26d9163a12e973d3a5336b36550b | |
| parent | e6ac744282be614535fa291dbfe40f41157c7a96 (diff) | |
| download | php-git-f52edc19a72dcfe53824104a3c752da301814c6e.tar.gz | |
Improve error message - on E_STRICT, method is actually called,
so the error shouldn't say it cannot be called.
| -rw-r--r-- | Zend/zend_execute.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |
