Exception::__construct

(PHP 5 >= 5.1.0, PHP 7) Construct the exception public Exception::__construct ([ string $message = "" [, int $code = 0 [, Throwable $previous = NULL ]]] ) Constructs the Exception. Parameters: message The Exception message to throw. code The Exception code. previous The previous exception used for the exception cha

Exception::getMessage

(PHP 5 >= 5.1.0, PHP 7) Gets the Exception message final public string Exception::getMessage ( void ) Returns the Exception message. Returns: Returns the Exception message as a string. Examples: Exception::getMessage() example <?php try {     throw new Exception("Some error message"); } catch(Exception $e) {     ech

Exception::getPrevious

(PHP 5 >= 5.3.0, PHP 7) Returns previous Exception final public Exception Exception::getPrevious ( void ) Returns previous Exception (the third parameter of Exception::__construct()). Returns: Returns the previous Exception if available or NULL otherwise. Examples: Exception::getPrevious() example Looping over, and prin

Exception::getCode

(PHP 5 >= 5.1.0, PHP 7) Gets the Exception code final public mixed Exception::getCode ( void ) Returns the Exception code. Returns: Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException). Examples: Exception::getCode() example <?

Exception::getFile

(PHP 5 >= 5.1.0, PHP 7) Gets the file in which the exception occurred final public string Exception::getFile ( void ) Get the name of the file the exception was created. Returns: Returns the filename in which the exception was created. Examples: Exception::getFile() example <?php try {     throw new Exception; } cat

Exception::getLine

(PHP 5 >= 5.1.0, PHP 7) Gets the line in which the exception occurred final public int Exception::getLine ( void ) Get line number where the exception was created. Returns: Returns the line number where the exception was created. Examples: Exception::getLine() example <?php try {     throw new Exception("Some error 

Exception::getTrace

(PHP 5 >= 5.1.0, PHP 7) Gets the stack trace final public array Exception::getTrace ( void ) Returns the Exception stack trace. Returns: Returns the Exception stack trace as an array. Examples: Exception::getTrace() example <?php function test() {  throw new Exception; } try {  test(); } catch(Exception $e) {  var_

Exception::getTraceAsString

(PHP 5 >= 5.1.0, PHP 7) Gets the stack trace as a string final public string Exception::getTraceAsString ( void ) Returns the Exception stack trace as a string. Returns: Returns the Exception stack trace as a string. Examples: Exception::getTraceAsString() example <?php function test() {     throw new Exception; }

Exception::__toString

(PHP 5 >= 5.1.0, PHP 7) String representation of the exception public string Exception::__toString ( void ) Returns the string representation of the exception. Returns: Returns the string representation of the exception. Examples: Exception::__toString() example <?php try {     throw new Exception("Some error messag

Exception::__clone

(PHP 5 >= 5.1.0, PHP 7) Clone the exception final private void Exception::__clone ( void ) Tries to clone the Exception, which results in Fatal error. Returns: No value is returned. Exception: Exceptions are not clonable.