|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-23 13:26 UTC] narf at devilix dot net
[2017-01-23 13:48 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 16:00:01 2025 UTC |
Description: ------------ When setting your own custom error handler and then calling an undefined function then the error handler isn't triggered. I read on the manual that: "If errors occur before the script is executed (e.g. on file uploads) the custom error handler cannot be called since it is not registered at that time." But I would expect undefined function errors to be apart of the execution as a function might be created dynamiclly. I also found bug '#11803' and read that fatal errors aren't passed to custom error handler functions, but It would be nice to be able to fetch such errors in larger applications. Cheers Reproduce code: --------------- <?php function error_handler($errno, $errstr, $errfile = NULL, $errline = NULL, $errcontext = NULL) { var_dump($errno, $errstr, $errfile, $errline); return(true); } set_error_handler('error_handler'); undef_function(); /** Rest of the script */ ?> Expected result: ---------------- int(2) string(28) "Call to undefined function undef_function()" string(29) "/webserver/webroot/test.php" int(11) Actual result: -------------- Fatal error: Call to undefined function undef_function() in /webserver/webroot/test.php on line 11