Christian Schneider wrote:

Andrey Hristov wrote:

Good question. Having an error handling function becomes really
expensive if your code is not E_ALL-clean in a loop or something.


if you set a custom error handler you know what you are doing
and probably don't have such places in the code :)


No, that's where you are wrong: I use the auto-initialization feature for variables/array elements all the time (I think it's one of PHP's best features, despise me if you want) but I want to be able to give a debug_backtrace and other info in case there's a _real_ runtime error.

That's your view :)
A bug like this :
$a["some_index "]++ instead of $a["some_index"]++ lied quite a long time in a code that I used to manage till few months
ago. And if I was just relying on PHP's internal initialization and just skip that line - too bad
I wouldn't find this bugchen.


E_NOTICEs exists for good not for bad. If one codes a simple web interface it's ok for him to use
the autoinitialization but in 99.999% of the cases the user won't use and probably will never
hear about custom error handler (in the case of no custom handler there is no performance loss).


My slogan for E_NOTICEs : "smash 'em all" :) (and I was really forced to smash them by my previous project leader)



'Nuf said,

Sure


- Chris

Andrey

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to