PHP error_get_last() Function

PHP error_get_last Function


Definition :

The error_get_last() is inbuilt function in php.The PHP error_get_last() function is used to get the information about the last occurred error and the output display inassociative array form.

An associative array describing the last error with following keys:

  • "type" - The error type
  • "message" - The error message
  • "file" - The file where the error occurred
  • "line" - The line number where the error occurred
Syntax

   error_get_last();

Example :

Given below example use of error_get_last() function :

Output :