ID: 24216 Updated by: [EMAIL PROTECTED] Reported By: redeye at erisx dot de -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux / Windows PHP Version: 4.3.2 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is expected behavior, otherwise PHP will end up in a never-ending loop calling the error handler from the error handler... Previous Comments: ------------------------------------------------------------------------ [2003-06-17 01:24:50] redeye at erisx dot de Description: ------------ It seams like PHP doesn't keep the error_handler when a function is called which contains another trigger_error. This can lead to a quite unwanted behaviour on scripts that require an own error_handler. Reproduce code: --------------- <?php function my_error_handler($error_number,$error_message,$error_filename,$error_line){ echo 'Using my_error_handler: '.$error_message.'<br>'; if ( $error_number == E_USER_NOTICE ){ call_error(); } } function call_error(){ trigger_error('From call_error()', E_USER_WARNING); } set_error_handler('my_error_handler'); trigger_error('test', E_USER_NOTICE); trigger_error('another test', E_USER_NOTICE); ?> Expected result: ---------------- Using my_error_handler: test Using my_error_handler: From call_error() Using my_error_handler: another test Using my_error_handler: From call_error() Actual result: -------------- Using my_error_handler: test Warning: From call_error() in /www/test.php on line 11 Using my_error_handler: another test Warning: From call_error() in /www/test.php on line 11 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24216&edit=1