Resolve bitwise not on constant integer#4437
Conversation
4477c49 to
64dba66
Compare
386d808 to
dac0def
Compare
dac0def to
a1ee07d
Compare
a1ee07d to
bc5680e
Compare
|
WDYT of this small fix @staabm @ondrejmirtes ? |
I am not sure this argument makes sense, since as far as I understand it I think we need to either judge whether...
|
When I tried I got |
|
Thank you. |
|
Either this or #4435 is a reason for a new error: Do you think it's valid or not? I suspect the code should be parenthesized like this |
|
Were does come from this error ? I don't see such code in phpstan codebase.
This seems valid to me, I think it should be |
|
Each commit to PHPStan is analysed on four private projects only I have access to. |
agree |
While working on #4435 I discovered the issue phpstan/phpstan#9384 was almost solve except for the operation with the bitwise operator not
~.This one generalize constant integer into integer while we could compute the value.
A comment is saying it depends on PHP_INT_SIZE but we could consider that
~are on small number<<https://phpstan.org/r/58bdfbb7-a047-44ff-8af3-995d976d7bb5