ErrorExceptionIntroductionAn Error Exception. Class synopsis
ErrorException
extends
Exception
/* Properties */
protected
int
$severity = E_ERROR;
/* Inherited properties */
protected
string
$message = "";
private
string
$string = "";
protected
int
$code;
protected
string
$file = "";
protected
int
$line;
private
array
$trace = [];
private
Throwablenull
$previous = null;
/* Methods */
public ErrorException::__construct(
string $message = "",int $code = 0,int $severity = E_ERROR ,stringnull $filename = null ,intnull $line = null ,Throwablenull $previous = null ) final public int ErrorException::getSeverity()
/* Inherited methods */
final public string getMessage()
final public Throwablenull getPrevious()
final public int getCode()
final public string getFile()
final public int getLine()
final public array getTrace()
final public string getTraceAsString()
public string __toString()
private void __clone()
Properties
Examples
Example #1 Use set_error_handler to change error messages into ErrorException
The above example will output something similar to: Fatal error: Uncaught ErrorException: unserialize(): Error at offset 0 of 11 bytes in test.php:16 Stack trace: #0 [internal function]: {closure}(2, 'unserialize(): ...', 'test.php', 16) #1 test.php(16): unserialize('broken data') #2 {main} thrown in test.php on line 16
|