Mehman Manafov
Mehman Manafov

Reputation: 449

how to catch php E_PARSE error with custom error handler?

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

Upvotes: 2

Views: 562

Answers (1)

DevZer0
DevZer0

Reputation: 13545

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

Upvotes: 2

Related Questions