Not exactly answering the question, but I think this is a better compromise in some situations:
I had a warning message as a result of a printf() statement in a third-party library. I knew exactly what the cause was - a temporary work-around while the third-party fixed their code. I agree that warnings should not be suppressed, but I could not demonstrate my work to a client with the warning message popping up on screen. My solution:
To suppress warnings while leaving all other error reporting enabled:
I do it as follows in my php.ini:
This logs only fatal errors and no warnings.
Not exactly answering the question, but I think this is a better compromise in some situations:
I had a warning message as a result of a printf() statement in a third-party library. I knew exactly what the cause was - a temporary work-around while the third-party fixed their code. I agree that warnings should not be suppressed, but I could not demonstrate my work to a client with the warning message popping up on screen. My solution:
Warning was still in page source as a reminder to me, but invisible to the client.
I think that better solution is configuration of .htaccess In that way you dont have to alter code of application. Here are directives for Apache2