Eri*_*ney -3 php try-catch throw
好的,所以我是错误处理的新手,我已经看到了一些例子,但我还没有看到这个问题的答案.我将使用一些真正的基本示例代码来显示我在问什么.
if(some condition){
throw Exception()
}
//Some random code in between
echo "Code between throw() and Catch()";
catch(Exception $e){
//handle the caught exception
}
Run Code Online (Sandbox Code Playgroud)
所以基本上,我的问题是 - 如果if()中的条件导致抛出异常,随机echo语句会执行,还是会跳过并直接进入异常的catch()?
| 归档时间: |
|
| 查看次数: |
101 次 |
| 最近记录: |