set_error_handler()不能抓住一个致命的错误(见一个特定类型的错误手册)。

所以我们需要以下方法:


< PHP
ini_set('max_execution_time ',1);
函数关闭(){
($ = error_get_last);
print_r(美元);
}
register_shutdown_function('shutdown);
当(真){
}




注:睡眠()暂停时间不在max_execution_time。