php8.5
Home/ Manual/ predefined / error/ Error::__construct

Error::__construct

PHP function Edit on GitHub ✎

(PHP 7, PHP 8)

Construct the error object

Description

Error::__construct(string $message = "", int $code = 0, Throwable|null $previous = null)

Constructs the Error.

Parameters

message

The error message.

code

The error code.

previous

The previous throwable used for the exception chaining.

Notes

Note

The message is NOT binary safe.

Source: language/predefined/error/construct.xml · from the official PHP manual (php/doc-en)