【发布时间】:2016-05-18 03:17:18
【问题描述】:
这个例子很难描述?
public function x()
{
try
{
operation();
return true;
}
catch (\Exception $e)
{
return false;
}
can this reach this line???
}
那么有没有一种既不返回true也不返回false的方法?不知何故。无论如何。
【问题讨论】:
-
不,您无法到达该行,因为您在 try / catch 语句中返回 true 或 false。你想做什么?
-
如果你想到达那条线,不要在
try catch返回值。 -
你不想要什么?
-
我加了解释