Php methods for obtaining error information, php methods for obtaining error information
This example describes how to get error information from php. Share it with you for your reference. The details are 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 ($! = 8 & $ a) {$ er = $ ar [$ 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 );}
I hope this article will help you with php programming.