我有这样的代码:PHP逻辑运算符IF语句
if (($oldTime < (time() - self::wait))) {
if ($this->setTime())
{
return true;
}
else
{
return false;
}
} else {
return false;
}
我可以将其替换为:
if (($oTime < (time() - self::wait)) && $this->setTime()) {
return true;
} else {
return false;
}
我需要它来检查,如果$this->setTime()
返回true仅当$oTime < (time() - self::wait)
是真实的。
是的,你可以,这是一样的。 – dfsq 2013-03-12 19:56:56
* Offtopic *老兄,我们拥有相同的头像......尊重我的权威! :-D – Quasdunk 2013-03-12 20:04:58
@Quasdunk哈哈) – rinchik 2013-03-12 20:13:32