Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ErrorError::getMessage>
^ErrorLast updated: Mon, 26 Oct 2026

Error::__construct

(PHP 7, PHP 8)

Error::__construct — Construct the error object

Description

public function Error::__construct(string $message = "", int $code = 0, ?Throwable $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.


<ErrorError::getMessage>
^ErrorLast updated: Mon, 26 Oct 2026