|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-17 02:14 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Feb 18 22:00:01 2026 UTC |
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