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
Class constants where value starts with an operand are not recognized #8307
Comments
I found these snippets: https://psalm.dev/r/b100090d84<?php
class test {
public const BITFLAG_ALL = ~0;
public const BOOL_TRUE = !false;
}
print_r(test::BITFLAG_ALL);
print_r(test::BOOL_TRUE ? 'true' : 'false');
|
As an aside, I've had a quick look through the code to see if I could fix this, but I'm having a hard time figuring out what part of the code this is likely to be in. If someone could give a pointer where this is likely to originate, I'd be happy to give it another go. |
My first guess would be it's a parsing issue in either Second guess would be |
Fixed in #8360 |
If the value for a class constant starts with an operand, like
!
or~
, Psalm doesn't register it, and throws anUndefinedConstant
error.https://psalm.dev/r/b100090d84
The text was updated successfully, but these errors were encountered: