Exception::__construct( string $message, string $type, mixed $data = null, integer $code )

In this article

Create a new exception

Parameters

$messagestringrequired
Exception message
$typestringrequired
Exception type
$datamixedoptional
Associated data

Default:null

$codeintegerrequired
Exception numerical code, if applicable

Source

public function __construct($message, $type, $data = null, $code = 0) {
	parent::__construct($message, $code);

	$this->type = $type;
	$this->data = $data;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.