SAR*_*SAR 1 php operator-precedence operator-keyword
我们知道=优先级低于!.
我的问题:如果上述句子为真,那么如何执行以下if()条件
function foo()
{
return false;
}
if(!$a=foo())
{
echo "Yes, foo() appeared here.";
}
Run Code Online (Sandbox Code Playgroud)
这是一项任务,而非比较.此外,您还有一个调用所需的函数调用.然后订单是:
1) Function call returning false;
2) Assignment of false value to $a;
3) Negation of $a as !false, i.e., true.
Run Code Online (Sandbox Code Playgroud)