• PHP reference
  • Sandbox
  • Errors

Throwable

class Sandbox\Errors\Throwable

Class Throwable

Methods

__construct(Throwable $throwable)

Throwable constructor.

Parameters

string getMessage()

Gets the message

Return Value

  • string

integer getCode()

Gets the exception code

Return Value

  • integer Returns the exception code as integer in {see Exception} but possibly as other type in {see Exception} descendants (for example as string in {see PDOException}).

string getFile()

Gets the file in which the exception occurred

Return Value

  • string Returns the name of the file from which the object was thrown.

integer getLine()

Gets the line on which the object was instantiated

Return Value

  • integer Returns the line number where the thrown object was instantiated.

array getTrace()

Gets the stack trace

Return Value

  • array Returns the stack trace as an array in the same format as {see debug_backtrace()}.

string getTraceAsString()

Gets the stack trace as a string

Return Value

  • string Returns the stack trace as a string.

Throwable getPrevious()

Returns the previous Throwable

Return Value

  • Throwable Returns the previous {see Throwable} if available, or NULL otherwise.

string __toString()

Gets a string representation of the thrown object

Return Value

  • string Returns the string representation of the thrown object.