当三元运算符条件成立时,且结果与条件一致时,能够省略结果。php
php > $a = 5; php > echo $b = $a ?: 'hello world'; 5 php > $a = 0; php > echo $b = $a ?: 'hello world'; hello world