?
avatar PhilETaylor
PhilETaylor
18 Apr 2021

170 uses in Joomla 4 - mainly in libraries, 63 in upstream packages

https://www.php.net/manual/en/reserved.variables.phperrormsg.php

Version Description
PHP 8.0.0 Directive track_errors which caused $php_errormsg to be available has been removed.
PHP 7.2.0 Directive track_errors which caused $php_errormsg to be available has been deprecated.

Screenshot 2021-04-18 at 15 58 15

avatar PhilETaylor PhilETaylor - open - 18 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Apr 2021
avatar PhilETaylor PhilETaylor - change - 18 Apr 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 18 Apr 2021
avatar PhilETaylor PhilETaylor - change - 18 Apr 2021
Title
[4] Directive track_errors which caused $php_errormsg to be available has been removed.
[4][PHP8] Directive track_errors which caused $php_errormsg to be available has been removed.
avatar PhilETaylor PhilETaylor - edited - 18 Apr 2021
avatar PhilETaylor PhilETaylor - change - 18 Apr 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 18 Apr 2021
avatar PhilETaylor PhilETaylor - change - 18 Apr 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 18 Apr 2021
avatar richard67
richard67 - comment - 18 Apr 2021

So we should use error_get_last() and get the 'message' element where we now use $php_errormsg, right?

avatar PhilETaylor
PhilETaylor - comment - 18 Apr 2021

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);

Add a Comment

Login with GitHub to post a comment