I'm pretty sure, that the documentation is wrong here.
Operator ** has greater precedence than ++.
This statement seems in contradiction with how grouping obeys to operator precedence.
Operator precedence and associativity only determine how expressions are grouped, they do not specify an order of evaluation.
In fact if we group **
before ++
, we obtain ++($a ** 2)
, like it is stated in the question. But this expression is not even valid, because the ++
operator can only be used for a variable, but not for an expression.
The fact that ++
is only valid for a variable implies that no operator with two operands can have higher precedence.