mirror of
https://github.com/php/php-src.git
synced 2026-03-27 09:42:22 +01:00
-Add comment that explains wh we need E_ERROR in those cases
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user