处理函数调用过程中的致命错误


Handle fatal error during function calling

我有一个用cron作业生成pdf报告的程序。现在有时致命的错误来了,我正试图用try-catch块来处理这个问题

$pdfcalass->display();
$pdfcalass->Output("$filename",'F');

我需要处理调用两个函数时产生的致命错误。我试过这个

register_shutdown_function('shutdownFunction',$request_id);
$pdfcalass->display();
$pdfcalass->Output("$filename",'F');

但不工作

获取php中的最后一个错误error_get_last:

function shutdownFunction($request_id){
    // something with $request_id;
    print_r(error_get_last());
}
register_shutdown_function('shutdownFunction', $request_id);