2

I tried using register_shutdown and set_error_handler together but no luck.Does anyone know another solution to this problem?

1 Answer 1

2

here is a snippet from the documentations

The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.

E_PARSE stops the execution immediately so it will have no way to call any other function

Sign up to request clarification or add additional context in comments.

1 Comment

E_ERROR stops the execution too but it is possible to catch E_ERROR within register_shutdown() function using error_get_last() function and call custom error handler with that error.but it doesnt work with E_PARSE error.so register_shutdown() is not called when E_PARSE error happened?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.