三元运算符嵌套问题

错误写法:$a==true ? 1 : $a==false ? 0 : 1

正确写法:$a==true ? 1 : ($a==false ? 0 : 1)

posted @ 2021-07-23 14:25  事儿爸_董  阅读(138)  评论(0编辑  收藏  举报