|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-11-18 14:17 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: cmb
[2021-11-18 14:17 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 07:00:01 2025 UTC |
Description: ------------ the first call to set_error_handler returns NULL on success. on failure, e.g., if the desired callback function has not been declared, an E_WARNING is thrown and NULL is returned. this makes checking for failure of this function a little kludgy. it would be better to always return FALSE on error, or, return the name of the internal PHP error handler on success, which is what our custom error handlers will be replacing on the first call. by looking at previous bugs about this, it seems as though the documentation was right and the code was wrong. Reproduce code: --------------- <? function foo() { echo 'foo'; } echo (NULL === set_error_handler('foo')); echo (NULL === set_error_handler('bar')); ?> Expected result: ---------------- 1foo Actual result: -------------- 1foo1