首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Throwable

Introduction

(PHP 7)

Throwable is the base interface for any object that can be thrown via a throw statement in PHP 7, including Error and Exception.

Note: PHP classes cannot implement the Throwable interface directly, and must instead extend Exception.

Interface synopsis

Throwable {

/* Methods */

代码语言:javascript
复制
abstract public string getMessage ( void )
代码语言:javascript
复制
abstract public int getCode ( void )
代码语言:javascript
复制
abstract public string getFile ( void )
代码语言:javascript
复制
abstract public int getLine ( void )
代码语言:javascript
复制
abstract public array getTrace ( void )
代码语言:javascript
复制
abstract public string getTraceAsString ( void )
代码语言:javascript
复制
abstract public Throwable getPrevious ( void )
代码语言:javascript
复制
abstract public string __toString ( void )

}

Table of Contents

  • Throwable::getMessage — Gets the message
  • Throwable::getCode — Gets the exception code
  • Throwable::getFile — Gets the file in which the exception was created
  • Throwable::getLine — Gets the line on which the object was instantiated
  • Throwable::getTrace — Gets the stack trace
  • Throwable::getTraceAsString — Gets the stack trace as a string
  • Throwable::getPrevious — Returns the previous Throwable
  • Throwable::__toString — Gets a string representation of the thrown object

← IteratorAggregate::getIterator

Throwable::getMessage →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券