Converting PHP errors into exceptions

I’ve written error handling class which divided all errors into the normal ones (notices, warnings, …), and the critical ones.

Now I’ve found out that it’s a good practice to convert all errors into exceptions. It would also shorten my code.

However, I’m not sure how to handle this…

  1. Are there exceptions that don’t stop scripts execution, and exceptions that do? If there aren’t…how to differ converted errors?
  2. Converting errors into exception is done by calling set_error_handler() and throw new ErrorException() in there…What’s next? set_exception_handler() is called automagically?

Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.