English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Error & Loggings Reference Manual
The error_get_last() function returns the last occurred error.
array error_get_last ( void );
This function returns the last occurred error in the form of an array. If no error occurs, it returns NULL.
Serial number | Parameters and descriptions |
---|---|
1 | void No parameters |
It returns an associative array, and returns NULL if there is no error.
The returned error array includes 4 Keys and values:
[type] - Error type
[message] - Error message
[file] - The file where the error occurred
[line] - The line where the error occurred
Here is the usage of this error_get_last function-
<?php echo $b; print_r(error_get_last()); ?>Test and see‹/›
This will produce the following result-
Array ( [type] => 8 [message] => Undefined variable: a [file] => /var/www/w3codebox/php/test.php [line] => 2 )