在函数调用期间处理致命错误

时间:2015-12-30 06:38:24

标签: php

我有一个用cron作业生成pdf报告的程序。现在有时致命的错误即将到来,我试图用try catch块处理它

getRow()

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

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

但不工作

1 个答案:

答案 0 :(得分:0)

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

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