开发者

Type-less catch block in PHP

Has PHP any ability 开发者_如何学运维to catch all types of exceptions in one catch block? Is there any way to do this:

try  
{  
throw new Exception; OR throw new MyException;  
}  
catch(???)  
{
// Catch both exception types  
}


Exception is the super class of all exceptions. So:

catch (Exception $e) {
    // Catches any exception
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜