PHP error_get_last() Function
Complete PHP Error Reference Manual
Definition and Usage
The error_get_last() function gets the last error that occurred.
This function returns the last error that occurred as an array. If no error occurred, it returns NULL.
The returned error array contains 4 keys and values:
- [type] - Error type
- [message] - Error message
- [file] - The file in which the error occurred
- [line] - The line on which the error occurred
Syntax
error_get_last()
Example
The output of the code above is shown below:
Array
(
[type] => 8
[message] => Undefined variable: test
[file] => C:webfoldertest.php
[line] => 2
)
Complete PHP Error Reference Manual