Handle fatal errors in PHP using register_shutdown_function()

后端 未结 4 1531
南旧
南旧 2020-11-27 14:49

According to the comment on this answer it is possible to catch Fatal Errors through a shutdown function which cannot be caught using set_error_handler().

4条回答
  •  广开言路
    2020-11-27 15:00

    Just a nice trick to get the current error_handler method =)

    
    

    Also i wan't to note that if you call

    
    

    Php stops displaying the error, otherwise the error text will be send to the client prior to your error handler

提交回复
热议问题