Closed PhilETaylor closed 2 years ago
So we should use error_get_last()
and get the 'message'
element where we now use $php_errormsg
, right?
docs comments also say:
If an error handler (see set_error_handler ) successfully handles an error then that error will not be reported by this function.
so that will need testing too,
Maybe something like this which we use for deprecated errors in libraries/bootstrap.php might work for Notice/Warnings - no idea - not tested - looks like a nicerway to handle warnings and errors and would allow us to remove all @
suppression in Joomla 4?
set_error_handler(['Joomla\CMS\Exception\ExceptionHandler', 'handleUserDeprecatedErrors'], E_USER_DEPRECATED);
170 uses in Joomla 4 - mainly in libraries, 63 in upstream packages
https://www.php.net/manual/en/reserved.variables.phperrormsg.php