php 语法错误定位 try catch Throwable

try {
  
} catch (Exception $ex) {
     // 计算错误
}  catch (Throwable $ex) {
  // 语法错误,致命错误  
}
 
Throwable {
/* Methods */
abstract public string getMessage ( void )
abstract public int getCode ( void )
abstract public string getFile ( void )
abstract public int getLine ( void )
abstract public array getTrace ( void )
abstract public string getTraceAsString ( void )
abstract public Throwable getPrevious ( void )
abstract public string __toString ( void )
}
 
Throwable  是一个接口,Error 类和Exception 类都继承 Throwable 接口。
Error 就是用于语法错误和致命错误的捕捉的。
 
posted on 2016-06-02 16:00  mywebnumber  阅读(1289)  评论(0编辑  收藏  举报