Throwable

官方文档地址: http://php.net/manual/en/class.throwable.php

PHP 支持版本: 7

Throwable 是 PHP 7 中可以用作任何对象抛出声明的基本接口,包括 Expection (异常)和 Error (错误)。

 

Throwable {
    
  /* 抽象方法 */
  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 ) // 返回上一个 Throwable

  abstract public string __toString ( void ) // 抛出的对象以字符串形式返回,可以用 echo 打印相应结果

}

 

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2021-07-19
  • 2022-01-08
  • 2021-11-28
  • 2021-09-25
猜你喜欢
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
相关资源
相似解决方案