Throwable

(PHP 7, PHP 8)

Introduction

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

Note:

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

Interface synopsis

interfaceThrowableextendsStringable {
publicgetCode(): int
publicgetFile(): string
publicgetLine(): int
publicgetTrace(): array
}

Changelog

VersionDescription
8.0.0Throwable implements Stringable now.

Table of Contents

To Top