Skip to content
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

Report error for float used with modulo #10949

Open
kkmuffme opened this issue May 4, 2024 · 1 comment · May be fixed by #10958
Open

Report error for float used with modulo #10949

kkmuffme opened this issue May 4, 2024 · 1 comment · May be fixed by #10958

Comments

@kkmuffme
Copy link
Contributor

kkmuffme commented May 4, 2024

No error reported https://psalm.dev/r/7f4bfa83e6
PHP triggers notice https://3v4l.org/Cph3O

Deprecated: Implicit conversion from float 25.4 to int loses precision

Copy link

I found these snippets:

https://psalm.dev/r/7f4bfa83e6
<?php

$b = 25.4 % 2;
$d = 25.5 % 2.5;
Psalm output (using commit 08afc45):

INFO: UnusedVariable - 3:1 - $b is never referenced or the value is not used

INFO: UnusedVariable - 4:1 - $d is never referenced or the value is not used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants