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

Exception::__construct

(PHP 5, PHP 7, PHP 8)

Exception::__constructConstruct the exception

Descrizione

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

Constructs the Exception.

Elenco dei parametri

message

The Exception message to throw.

code

The Exception code.

previous

The previous exception used for the exception chaining.

Nota: Calling the constructor of class Exception from a subclass ignores the default arguments, if the properties $code and $message are already set.

Note

Nota:

The message is NOT binary safe.