-
Notifications
You must be signed in to change notification settings - Fork 2
Normalise parentheses #39
Conversation
tests/cases/php/parentheses-useless
Outdated
| switch ($quuz) { | ||
| case true: | ||
| case false: | ||
| return $corge / (100 + $grault); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the effect on (60 * 60 * 24) * $days (or similar) which has unnecessary parentheses but can make the calculation more clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better test case:
$ php -r "var_dump(true or false and false);"
bool(true)
$ php -r "var_dump(true or (false and false));"
bool(true)
$ php -r "var_dump((true or false) and false);"
bool(false)
The second case has unnecessary parentheses but is counterintuitive without them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All those examples are unaffected.
((60 * 60 * 24 * $days) is also unaffected when it is useless though.)
|
The build contains an unrelated error, but the concerns about parentheses have been addressed. |
|
Build problem is addressed in #37. |
No description provided.