?:
is a form of the conditional operator which was previously available only as:
expr ? val_if_true : val_if_false
In 5.3 it’s possible to leave out the middle part, e.g. expr ?: val_if_false
which is equivalent to:
expr ? expr : val_if_false
From the manual:
Since PHP 5.3, it is possible to leave out the middle part of the conditional operator. Expression
expr1 ?: expr3
returnsexpr1
ifexpr1
evaluates toTRUE
, andexpr3
otherwise.