Problems Suppressing Errors if Using a Custom Error Handler in PHP

December 5, 2007 – 9:15 am

I wrote a nifty little custom error handler for a PHP project I am working on and noticed I was getting more errors than I was before. Hmm…what was wrong? Apparently if you use a custom error handler in PHP you must explicitly check to see whether the error was manually suppressed.

// Skip the error if it was suppressed
if(error_reporting() == 0) return false;

Share

No related posts.

Post a Comment