-
-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP_MAJOR_VERSION always false comparison #4434
Comments
|
Where it is defined? I am getting the error with the latest |
Please reproduce that in a minimal repository. |
I already tried to search for that, but I mean where the range is defined. |
What range? The constant is always an |
I was able to reproduce! Here it is: https://phpstan.org/r/eb30f898-1007-4cea-9822-ad3cb3a49fa5 |
So weird. |
I am trying to figure out if my problem is related to this bug. I've got the following code: $rc = hash_hmac($algo, $password, $hmac);
if($rc === false)
return false; phpstan reports an error:
Sure, string and false will always evaluate to false, but the function
Return Values Returns a string containing the calculated message digest as lowercase hexits unless binary is set to true in which case the raw binary representation of the message digest is returned. Returns false when algo is unknown or is a non-cryptographic hash function. |
@Bill-ColeUS It's not relevant to this issue at all. Open a new issue. |
Fixed: phpstan/phpstan-src@42d0b36 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
PHP_MAJOR_VERSION
constant type is weirdly changed by using the constant in strict comparison.Code snippet that reproduces the problem
https://phpstan.org/r/eb30f898-1007-4cea-9822-ad3cb3a49fa5
Expected output
no error
The text was updated successfully, but these errors were encountered: