You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the wrong constants are used for analyzing the code. I run php version 8.2.4 on my local environment, but our production environment is on php 7.3.33. So I've put phpVersion: 70333 in our phpstan.neon file, and it's also in the platform section of our composer.json.
Since the password constants have been changed from int to string in php 7.4 it yields an error on the password_hash function.
Parameter #2 $algo of function password_hash expects int, string given.
Bug report
It seems that the wrong constants are used for analyzing the code. I run php version 8.2.4 on my local environment, but our production environment is on php 7.3.33. So I've put
phpVersion: 70333
in ourphpstan.neon
file, and it's also in the platform section of ourcomposer.json
.Since the password constants have been changed from int to string in php 7.4 it yields an error on the
password_hash
function.https://www.php.net/password_hash
https://www.php.net/manual/en/password.constants.php
Code snippet that reproduces the problem
https://phpstan.org/r/3a20f288-2c07-4fab-ab05-0b2e3512eb7e
Expected output
Since we use the
PASSWORD_BCRYPT
constant in our code, we would expect no errors for this line of code.Did PHPStan help you today? Did it make you happy in any way?
We've implemented phpstan on our projects as of today, we're sure it will make our code better in the future
The text was updated successfully, but these errors were encountered: