1.2.4. $php_errormsg Usage¶
The variable $php_errormsg is removed since PHP 8.0. $php_errormsg tracks the last error message, with the directive track_errors. All was removed in PHP 8.0, and shall be replaced with error_get_last().
<?php
function foo() {
global $php_errormsg;
echo 'Last error: '.$php_errormsg;
echo 'Also, last error: '.error_get_last();
}
?>
1.2.4.1. Connex PHP features¶
1.2.4.1.1. Suggestions¶
Use error_get_last() instead.
1.2.4.1.2. Specs¶
Short name |
Php/PhpErrorMsgUsage |
Rulesets |
|
Exakat since |
2.1.8 |
PHP Version |
With PHP 8.0 and older |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Changed Behavior |
PHP 8.0 - More |
Precision |
High |
Available in |