Hi!
Because it may force to fix the errors, rather then ignore them?
Come on. That doesn't make any sense. If people deliberately disabled the error, they don't want to see it, and they will not see it. Making it slow doesn't do anything useful. Let's insert some sleep()'s into zend_error() too, would it make it better? Let's make E_DEPRECATED take 5 seconds, that'll show them. Making engine work slow to force people into some behavior is very misguided idea. I can't believe it is proposed to make invisible slowdowns in unknown places as a means to make people write better code.
There is very little modern code that is @ ridden like the stuff written
If we discard emotional terms like "ridden" - there is such code in almost every major app out there. Just search for @fopen or @include or @xml or @eval - tons of examples. Ans the reason is simple - people do not always want PHP to display/log errors for them. Sometimes they don't care for the errors, sometimes they want to handle the error by other means.
before. The way to have the engine not do the work, would be as simple as fixing the code, which is the right solution here.
What you still can't see if that this code is not broken, there's nothing to fix - this code is EXPLICITLY saying "do this, and if there's a error - ignore it". That's what the author wants. It's not an omission or mistake - it's intentional, it's part of the requirements. Only error_reporting now is broken so ignored errors waste excessive time. The right solution here is to fix error system so ignored errors not waste excessive time.
The production value we use according to php.ini-production is E_ALL & ~E_DEPRECATED, which means E_NOTICE will not be hidden.
Which conveniently ignores my argument about all other error types and bigger argument that THERE ARE such types and people ignore them on purpose, not because they are stupid.
Well, if you are going to hide them, the no one will ever debug them, let alone know that they exist.
How one would know they exist if reporting is disabled? By guessing it from the slowdown? I can't believe deliberately slowing down user applications in unknown places is really being recommended as a way of debugging. The fact is we have error_reporting and @, and however you may hate them, they exist and they are used. My patch only makes them do what they should be doing from the start, while keeping BC and allowing a bit more flexibility in advanced cases where you have special needs (like monitoring system that collects unreported errors, etc.).
-- Stanislav Malyshev, Zend Software Architect s...@zend.com http://www.zend.com/ (408)253-8829 MSN: s...@zend.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php