array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'error.construct.php', 1 => 'Error::__construct', 2 => 'Construct the error object', ), 'up' => array ( 0 => 'class.error.php', 1 => 'Error', ), 'prev' => array ( 0 => 'class.error.php', 1 => 'Error', ), 'next' => array ( 0 => 'error.getmessage.php', 1 => 'Error::getMessage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'language/predefined/error/construct.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Error::__construct

(PHP 7, PHP 8)

Error::__construct初始化 error 对象

说明

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

初始化 Error。

参数

message

错误信息。

code

错误代码。

previous

先前的 throwable,用于异常链。

注释

注意:

message 不是二进制安全的。