-
Notifications
You must be signed in to change notification settings - Fork 650
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
$_SERVER['REQUEST_TIME_FLOAT'] is not always float #8552
Comments
Hey @sebastianbergmann, can you reproduce the issue on https://psalm.dev ? |
I understand why this can have a big impact for libraries that must rely on user inputs inside super-global variables but it's admittedly a very edge case. I don't think we should revert that back to mixed just because some user may put a PDO connection in there :p I think it's a legit case of suppressing here for your particular case. PS: sorry about the version, I tried to look that up but I don't have a clue how to fix it. If it was caused by the split we made between master branch and the 4.x branch, it may resolve itself after releasing Psalm 5 |
I created that PR which set this to float and as discussed in the PR the docs require it to be a float - yes users can change superglobals, but they shouldn't - this is the premise of static analysis, that types are what they are stated as in the docs. |
Okay. |
I just updated from Psalm 4.27.0 to 4.28.0 and ran into this:
Unfortunately, "Type float for $_SERVER['REQUEST_TIME_FLOAT'] is always float" is wrong. Developers can, and unfortunately they do, overwrite the super-global variable
$_SERVER['REQUEST_TIME_FLOAT']
with values that are not of type float.The text was updated successfully, but these errors were encountered: