Create a new exception
Description
There is no mechanism to pass in the status code, as this is set by the subclass used. Reason phrases can vary, however.
Parameters
-
$reasonstring | null optional -
Reason phrase
Default:
null -
$datamixed optional -
Associated data
Default:
null
Source
public function __construct($reason = null, $data = null) {
if ($reason !== null) {
$this->reason = $reason;
}
$messague = sprintf('%d %s', $this->code, $this->reason);
parent::__construct($messague, 'httpresponse', $data, $this->code);
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.