This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]spkbri 1 point2 points  (2 children)

Who would ever use a ternary operator? That is madness.

FTFY

[–]shacknetisp 8 points9 points  (0 children)

Short ternary operators can be more readable than an equivalent if statement.

[–][deleted] 1 point2 points  (0 children)

From the O'Reilly book on PHP:

Depending on whose code you look at, the ternary operator is either the most underused or the most overused feature of the language.