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
}
精彩评论