4 ms·
It doesn't actually change the INI file. It changes the error_reporting setting in memory while that one function is executing and when it finishes it changes i
by lonnyk 14y ago
It doesn't actually change the INI file. It changes the error_reporting setting in memory while that one function is executing and when it finishes it changes it back.
- VMG 14y agoIt still is a weird unexpected side effect and at least a hash lookup in a map
- lonnyk 14y agoI don't see how this is a 'side effect'. It accomplishes the exact task it is designed to and doesn't do any quirky, or 'side', behavior to the script. Also, I wouldn't be worried about one lookup. I'm pretty sure everything in PHP is in a hash map.
- maratd 14y agoNo, it's actually a good idea. That way I can programmatically check if any error is going to be reported inside of a method or function that's being silenced. And, on top of that, override the silencing within a method or function directly. Using an established interface provides me with a ton of options ... options I wouldn't have if it did some sort of internal voodoo.
- VMG 14y agoBut you then can never know what the actual real ini value is. The override should be a different interpreter state variable (if at all).