|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 19:00:01 2025 UTC |
Description: ------------ restore_error_handler() returns always true, no info. But in complex situations where included files could add other handlers, there's no way to be sure that the restored handler is the wanted one. This doubt could be prevented if restore_error_handler() would return the actual callable or null if at the end of the stack. Test script: --------------- file1.php ========= <?php set_error_handler('someFunct'); include 'file2.php'; restore_error_handler(); // Not enough! file2.php ========= <?php set_error_handler('anotherFunct'); Expected result: ---------------- NOT CORRECT! It could be an useful feature file1.php ========= <?php $prev = set_error_handler('someFunct'); include 'file2.php'; do { $actual = restore_error_handler(); // Run twice } while ($actual != $prev); file2.php ========= <?php set_error_handler('anotherFunct');