This article mainly introduces PHP for error handling of the common skills, interested in the reference of friends, I hope to be helpful to everyone.
This article describes how PHP obtains error information, as follows:
function Error_reg () {$ar =array ( e_error = ' error ', e_warning = ' WARNING ', e_parse = ' prase ', e_notice = ' NOTICE '); Register_shutdown_function (function () use ($ar) { $ers =error_get_last (); if ($ers [' type ']!=8 && $ers [' type ']) { $er = $ar [$ers [' type ']]. $ers [' type ']. ': '. ' '. $ers [' message ']. ' = '. $ers [' file ']. ' Line: ' $ers [' line ']. ' '. Date (' y-m-d h:i:s '). " \ n "; Error_log ($er, 3, '/tmp/php_error.log '); } }); Set_error_handler (function ($a, $b, $c, $d) use ($ar) { if ($a!=8 && $a) { $er = $ar [$a]. $a. ': ' $b. ' = ' . $c. ' line: '. $d. '. Date (' y-m-d h:i:s '). " \ n "; Error_log ($er, 3, '/tmp/php_error.log '); } },e_all ^ e_notice);}
Summary : The above is the entire content of this article, I hope to be able to help you learn.
Related recommendations:
Implement video capture in PHP
Implement video capture in PHP
Php+ajax real-time input automatic search matching method