- error_reporting: documentation ( source)
- set_error_handler: documentation ( source)
<?php
/*
getMessage ( void )
final public ExceptionException::getPrevious ( void )
final public stringException::getFile ( void )
final public arrayException::getTrace ( void )
final public stringException::getTraceAsString ( void )
public string Exception::__toString ( void )
final private voidException::__clone ( void )
*/
error_reporting(E_ALL);
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, '76', $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
try {
echo $x;
}
catch(Exception $e) {
echo $e->getCode();
}