class Error_handler{
function Error_handler(){
$this->_init();
}
function _init(){
/**
* Sets error handler to be Prado::phpErrorHandler
*/
set_error_handler(array($this,’handler_error’),error_reporting());
/**
* Sets exception handler to be Prado::exceptionHandler
*/
set_exception_handler(array($this,’handler_exception’));
}
function handler_error($errno,$errstr,$errfile,$errline){
printf(”%s,%s,%s,%s\n”,$errno,$errstr,$errfile,$errline);
}
function handler_exception($exception){
print_r($exception);
}
}
$h=new Error_handler();
$a=3/0;
throw new Exception();
?>

看完了要说点啥么?
You must be logged in to post a comment.