I have noticed that using php's error_reporting function at runtime seems to cause it to report notices that have occurred previously.
Is this by design, or is there a way to prevent it?
$er = error_reporting(E_ERROR);
$m = new MyClass();
$m->myFunction();
//error_reporting($er);
In the above code, myFunction()
calls 3rd-party code that raises warnings and/or "strict" notices. If the last line is commented out as it is above, those warnings and notices are not returned. However, if I uncomment that line so that error reporting can return to normal, the strict notices, but not the warnings, are reported at that point.
Update
I think this is not a problem with error_reporting
as I had originally thought, but instead an issue with Pear, the 3rd-party code I'm using.
See my post at php pear mail extension raises strict notices