1. ?:
<?php
//?;
echo true?'蟹黄堡':'海之霸'; //为真,输出蟹黄堡
$food='蟹黄堡';
echo $food?:'海之霸'; //和上面相同
echo $food?(true?:'hello'):'珊迪'; //嵌套,外面为真,输出括号里面的(为假,输出hello,为真,输出?true1)
2. ??
//??
$name = 0;
echo $name??'no'; //双?,(变量存在,且不为空),输出变量$name,不满足条件,输出no
echo isset($punch)?'yes':'no'; //先用isset判断变量是否存在
@20/0; //用@可以屏蔽warning