Negative Squares

Still my favorite PHP bug : literal negative value is squared, and is … negative. In fact, the ** operator has precedence over the minus operator, and the square is then executed before the negation. Hence, the negative results. It is useful to process, correctly, parenthesises, but not integers.

../_images/squared_negative.png