我有一个充满错误的问题——报告职能。
I want to save current error_reporting level, disable error reporting for few lines, and restore it back. So I have following code:
$oldErrorReporting = error_reporting();
error_reporting(0);
//Some code, that will generate warning, or error, that I don t want to show
error_reporting(oldErrorReporting);
So, if I remove last line, there are no errors, and everything works fine. But if I add last line, I got error that happen in code while error reporting was turned off. So, is there any was to clear those errors that happen while error_reporting level was 0, and restore default error reporting level, without those errors that happen while error report was tuned off?