PHP – Exception Constructor
The PHP Exception() constructor is used to create an Exception object and set some of its properties.
The PHP Exception() constructor is used to create an Exception object and set some of its properties.
The PHP getCode() method returns an integer which can be used to identify the exception.
The PHP getFile() method returns the absolute path to the file where an exception occurred.
The PHP getLine() method returns the line number of the line of code which threw the exception.
The PHP getMessage() method returns a description of the error or behaviour that caused the exception to be thrown.
The PHP getPrevious() method returns the previous exception when an exception is triggered by a previous exception. Otherwise it returns null.
The PHP getTrace() method returns a stack trace (information about the functions that are running at a given moment) in the form of an array.
The PHP getTraceAsString() method returns a stack trace (information about the functions that are running at a given moment) in the form of an string.