Home >php教程 >php手册 >PHP捕捉致命错误

PHP捕捉致命错误

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 19:32:101025browse

就是捕捉致命错误啦~ 无 ?phperror_reporting(0);function _rare_shutdown_catch_error(){ $_error=error_get_last(); if($_error in_array($_error['type'],array(1,4,16,64,256,4096,E_ALL))){ echo '致命错误:'.$_error['message'].'/br'; echo '文件:'.$_

就是捕捉致命错误啦~
<?php



error_reporting(0);



function _rare_shutdown_catch_error(){

            $_error=error_get_last();

            if($_error && in_array($_error['type'],array(1,4,16,64,256,4096,E_ALL))){

               

 echo '致命错误:'.$_error['message'].'</br>';

 echo '文件:'.$_error['file'].'</br>';

 echo '在第'.$_error['line'].'行</br>';

            }

 }

 

 register_shutdown_function("_rare_shutdown_catch_error");

test();



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:simplexml的对象转成数组Next article:抽奖函数升级版