On 24-Aug-09, at 3:59 PM, Stanislav Malyshev wrote:
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.
Unless your code is "ridden" or if you prefer "filled" with @ and/or
errors the speed improvement would be next to impossible to measure
since you'd be literally saving microseconds. You'd need to have a
substantial chunk of your code generating errors for your
optimizations to make a reliably measurable difference. More over, if
the user defines an error handler, which many applications,
frameworks, etc... do then your improvement is next to invisible in
between the overhead of executing PHP code to process the error.
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".
Vast majority of E_NOTICEs are not fixed not because people don't want
to, but rather due to the fact that for ages PHP's default settings
were set to ignore those errors. And E_NOTICES btw often could've let
people know about security faults before they were abused, such as
uninitialized variables and array keys that could be injected via
register_globals, extract() function, etc...
Stas, my biggest issue is that you are making this configurable value
that makes this open to abuse, rather then using 0 as default and
matching the error message creation to error reporting settings.
ILia
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php