From: Marcus Boerger Date: Sat, 2 Feb 2008 15:46:19 +0000 (+0000) Subject: -Add comment that explains wh we need E_ERROR in those cases X-Git-Tag: RELEASE_2_0_0a1~656 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b12839a3bfcfd1db0989feeb95bb85222df6c6a;p=php -Add comment that explains wh we need E_ERROR in those cases --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 3613c9eec9..5291c7eb5e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2767,6 +2767,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 cec985c7be..b77e7fdda1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1150,6 +1150,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 9c58613124..472e627648 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2032,6 +2032,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"; } @@ -2144,6 +2145,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) zend_error(E_STRICT, "Non-static method %v::%v() 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 %v::%v() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); } }