PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Expression without clarifying parentheses

Last modified: 16 May 2022

Reports potentially ambiguous expressions and proposes enclosing them in clarifying parentheses.

By using parentheses, you can increase code readability by grouping operations explicitly rather than relying on the implicit operator precedence and associativity. For more information, refer to Operator Precedence (php.net).

In the following example, several potential ambiguities are eliminated by introducing parentheses inside expressions.