我有两个将根据条件运行的功能。代码就像
$contact=($this->function() or $this->function1())
public function()
{
some codes
return contact;
}
public function1()
{
some codes
return contact;
}
它在 $contact 中返回我 bool true 或 false。我想返回值。该怎么办?
如果我这样给
$contact=$this->function() or $this->function1()
如果 function() 为假,它不会检查 function1()。