We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<?php declare(strict_types = 1); var_dump(!(12 % 12)); var_dump(!12 % 12);
Output:
bool(true) int(0)
Here I get an error, that the first parentheses are useless. But that's not the case, because the output is different, if I remove them.
The ! operator has a higher precedence than the module % operator: https://www.php.net/manual/en/language.operators.precedence.php
!
%
The text was updated successfully, but these errors were encountered:
See also #1674 (bit-shift operator) & #1672 (string concat & ternary operator)
This sniff doesn't seem to take context into account? 3 * (2 + 1) doesn't trigger UselessParentheses though ¯\_(ツ)_/¯
3 * (2 + 1)
Sorry, something went wrong.
No branches or pull requests
Output:
Here I get an error, that the first parentheses are useless. But that's not the case, because the output is different, if I remove them.
The
!
operator has a higher precedence than the module%
operator:https://www.php.net/manual/en/language.operators.precedence.php
The text was updated successfully, but these errors were encountered: