Re: Re: error_handler, was [PHP-DEV] B3, pear segfault,

From: Date: Thu, 18 Dec 2003 22:52:40 +0000
Subject: Re: Re: error_handler, was [PHP-DEV] B3, pear segfault,
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Groups: php.internals 
Request: Send a blank email to internals+get-6575@lists.php.net to get a copy of this message
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


« previous php.internals (#6575) next »