Code 1: echo $ a; echoprint_r (error_get_last (), true); error prompt: Code 2: set_error_handler (& #039; appError & #039 ;); functionappError ($ errno, $ errstr, $ errfile, $ errline) {echo & #039; appError & #039 ;. $ errno. $ errstr ....
Code 1:
Echo $;
Echo print_r (error_get_last (), true );
Error message:
Code 2:
Set_error_handler ('apache ');
Function appError ($ errno, $ errstr, $ errfile, $ errline)
{
Echo 'apperror '. $ errno. $ errstr.' ['. print_r (error_get_last (), true).']
';
}
Echo $;
Error message:
Why cannot error be caught in Code 2 error_get_last ???
Reply content:
Code 1:
Echo $;
Echo print_r (error_get_last (), true );
Error message:
Code 2:
Set_error_handler ('apache ');
Function appError ($ errno, $ errstr, $ errfile, $ errline)
{
Echo 'apperror '. $ errno. $ errstr.' ['. print_r (error_get_last (), true).']
';
}
Echo $;
Error message:
Why cannot error be caught in Code 2 error_get_last ???
I seem to understand that when the error is handled by the custom appError, error_get_last () cannot catch the error. Even if error_get_last () is in appError, I am so smart.