parent root
PHP: Throwable - Manual
PHP 7.2.23 Release Announcement

Throwable

(PHP 7)

Introduction

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 */
abstract public getMessage ( void ) : string
abstract public getCode ( void ) : int
abstract public getFile ( void ) : string
abstract public getLine ( void ) : int
abstract public getTrace ( void ) : array
abstract public getTraceAsString ( void ) : string
abstract public getPrevious ( void ) : Throwable
abstract public __toString ( void ) : string
}

Table of Contents

add a noteadd a note

User Contributed Notes 1 note

up
52
mlocati at gmail dot com
2 years ago
I wrote a simple script that prints out the Throwable and Exception tree for every PHP version.

You can find this script here:
https://gist.github.com/mlocati/249f07b074a0de339d4d1ca980848e6a

And its output is here:
https://3v4l.org/sDMsv
To Top
parent root