How to catch undefined functions with set_error_handler in PHP

后端 未结 6 487
一整个雨季
一整个雨季 2021-02-05 19:47

I\'m taking the leap: my PHP scripts will ALL fail gracefully!

At least, that\'s what I\'m hoping for...`

I don\'t want to wrap (practically) every single line i

6条回答
  •  滥情空心
    2021-02-05 20:47

    I guess you needs to use register_shutdown_function also

    For example:

     register_shutdown_function( array( $this, 'customError' ));.
    
       function customError() 
       {
    
         $arrStrErrorInfo = error_get_last();
    
         print_r( $arrStrErrorInfo );
    
       }
    

提交回复
热议问题