当三元运算符条件成立时,且结果与条件一致时,可以省略结果。

php > $a = 5;php > echo $b = $a ?: 'hello world';5php > $a = 0;php > echo $b = $a ?: 'hello world';hello world