error_reporting(0);//所有的错误都不用系统定定义的function user_define_error_handle($errorNo, $errorMessage, $errorFile = __FILE__, $errorLine = __LINE__){ echo xml_error(903); write_log($errorNo.' '.$errorMessage.' '.$errorFile.' '.$errorLine); exit();}set_error_handler("user_define_error_handle",E_ALL);//检测NOTICE错误function shutdown_program() { $error = error_get_last(); if ($error['type'] == 1) { //只针对E_ERROR echo xml_error(904); write_log('message:'.$error['message'].' file:'.$error['file'].' line:'.$error['line']); }}register_shutdown_function('shutdown_program');//针对E_ERROR错误