$php_errormsg — The previous error message
This feature has been DEPRECATED as of PHP 7.2.0. Relying on this feature is highly discouraged.
Use error_get_last() instead.
$php_errormsg is a variable containing the text of the last error message generated by PHP. This variable will only be available within the scope in which the error occurred, and only if the track_errors configuration option is turned on (it defaults to off).
If a user defined error handler (set_error_handler()) is set $php_errormsg is only set if the error handler returns
Example #1 $php_errormsg example
<?php @strpos(); echo $php_errormsg; ?>
The above example will output something similar to:
Wrong parameter count for strpos()
- error_get_last() - Get the last occurred error
Is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML
When PHP parses a file, it looks for opening and closing tags, which are <?php and ?> which tell PHP to start and stop interpreting the code between them.
Variables in PHP
Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.