Unlike most (all?) other languages, the ternary operator in PHP is left-associative rather than right-associative. The left-associative behavior is generally not useful and confusing for programmers who switch between different languages. This RFC proposes to deprecate and remove left-associativity for the ternary operator and require explicit use of parentheses instead.

As an example, the code

return $a == 1 ? 'one' : $a == 2 ? 'two' : $a == 3 ? 'three' : $a == 4 ? 'four' : 'other' ;

would in most (all?) other languages be interpreted as

return $a == 1 ? 'one' : ( $a == 2 ? 'two' : ( $a == 3 ? 'three' : ( $a == 4 ? 'four' : 'other' ) ) ) ;

which is both the useful and intuitive interpretation. In PHP, it is instead interpreted as

return ( ( ( $a == 1 ? 'one' : $a == 2 ) ? 'two' : $a == 3 ) ? 'three' : $a == 4 ) ? 'four' : 'other' ;

which is generally not what was intended.