From: Marcus Boerger Date: Sat, 2 Feb 2008 15:48:04 +0000 (+0000) Subject: - MFH Add comment that explains why we need E_ERROR in those cases X-Git-Tag: RELEASE_1_3_1~157 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da5b979f8888a5910850304051d78f0a17000f13;p=php - MFH Add comment that explains why we need E_ERROR in those cases --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 7cc2189181..fe921a0ddc 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2406,6 +2406,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze severity = E_STRICT; verb = "should not"; } else { + /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ severity = E_ERROR; verb = "cannot"; } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 1eca3b1ec8..8b5b08be59 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1051,6 +1051,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS severity = E_STRICT; verb = "should not"; } else { + /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ severity = E_ERROR; verb = "cannot"; } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 8cb595e36e..a89f6d7660 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1975,6 +1975,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS severity = E_STRICT; verb = "should not"; } else { + /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ severity = E_ERROR; verb = "cannot"; } @@ -2082,6 +2083,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); } else { /* FIXME: output identifiers properly */ + /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); } }