How can I test if exit is clean in a shutdown function in PHP?
By clean exit I mean that the script was not terminated due to an error.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Its a good question, for the moment I only have this idea: register a shutdown function like this:
With
auto_append_fileadd an additional file to the very end of every script execution which sets an constant.Your auto_append_file.php content:
In case you dont want to edit the php.ini you could do check
error_get_last()or$php_errormsgin your register shutdown function!