Short ternary operator

Shortened version of ternary operator is available since PHP 5.3

Below program shows a random number, or "rand below 5" if number is below 5:

 

$rand = rand(0, 20);
$out = ($rand >= 5) ?: 'rand below 5';
echo $out;