&
bitwise operator is interpreted as "reference" operator by unary_operator_spaces
#7861
Labels
&
bitwise operator is interpreted as "reference" operator by unary_operator_spaces
#7861
Bug report
Hi! Thank you for PHP-CS-Fixer! I'm having an issue with version 3.51.0 (and probably those before too).
Description
When trying to fix the current snippet, PHP-CS-Fixer wants to edit it the wrong way, interpreting the
&
character as a unary operator (for reference I guess) instead of bitwise operator "AND".To me, this is incorrect as I have the
binary_operator_spaces
enabled which takes care of that bitwise operator.I know it cold be super hard to detect how to interpret
&
character from static analysis, but at least maybe handling the case where right operand is a constant so it can't be a reference could help a bit? Or if you know a better way to handle this conflicting case…Thanks a lot!
Runtime version
PHP-CS-Fixer: 3.51.0
PHP: 8.3.2
The text was updated successfully, but these errors were encountered: