The error_get_last() function gets the last error that occurred.
This function returns the last errors that occurred as an array. Returns NULL if no error occurs.
The returned error array contains 4 key names and key values:
[type] - error type
[message] - error message
[file] - the file where the error occurred
[line] - The line where the error occurred
error_get_last()
<?phpecho $test;print_r(error_get_last());?>
The output of the above code looks like this:
Array([type] => 8[message] => Undefined variable: test[file] => C:webfoldertest.php[line] => 2)