Re:Five reasons why the PHP silence operator @ should be avo...
by lonnyk on Thursday January 10, 2013 @02:03PM
(#5038990)
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.
[ Parent
| on HN ]
Re:Five reasons why the PHP silence operator @ should be avo...
by VMG on Thursday January 10, 2013 @02:51PM
(#5039320)
It still is a weird unexpected side effect and at least a hash lookup in a map
Re:Five reasons why the PHP silence operator @ should be avo...
by maratd on Thursday January 10, 2013 @03:39PM
(#5039591)
No, 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.
Re:Five reasons why the PHP silence operator @ should be avo...
by VMG on Thursday January 10, 2013 @04:33PM
(#5039889)
But you then can never know what the actual real ini value is. The override should be a different interpreter state variable (if at all).
Re:Five reasons why the PHP silence operator @ should be avo...
by lonnyk on Thursday January 10, 2013 @03:35PM
(#5039572)
I 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.