Exception Class Reference
[Zend engine classes]

Basic Exception class. More...

Inheritance diagram for Exception:

Inheritance graph
{LogicException\n||}{RuntimeException\n||}{BadFunctionCallException\n||}{DomainException\n||}{InvalidArgumentException\n||}{LengthException\n||}{OutOfRangeException\n||}{BadMethodCallException\n||}{OutOfBoundsException\n||}{OverflowException\n||}{RangeException\n||}{UnderflowException\n||}{UnexpectedValueException\n||}
[legend]
List of all members.

Public Member Functions

 __construct ($message=NULL, $code=0)
 __toString ()
 getCode ()
 getFile ()
 getLine ()
 getMessage ()
 getTrace ()
 getTraceAsString ()

Protected Attributes

 $code
 $file
 $line
 $message

Private Member Functions

 __clone ()

Private Attributes

 $string
 $trace

Detailed Description

Basic Exception class.

Since:
PHP 5.0

Definition at line 244 of file spl.php.


Constructor & Destructor Documentation

Exception::__construct ( message = NULL,
code = 0 
)

Construct an exception.

Parameters:
$message Some text describing the exception
$code Some code describing the exception

Definition at line 273 of file spl.php.

References $code, and $message.

00273                                                      {
00274         if (func_num_args()) {
00275             $this->message = $message;
00276         }
00277         $this->code = $code;
00278         $this->file = __FILE__; // of throw clause
00279         $this->line = __LINE__; // of throw clause
00280         $this->trace = debug_backtrace();
00281         $this->string = StringFormat($this);
00282     } 


Member Function Documentation

Exception::__clone (  )  [final, private]

Prevent clone.

Definition at line 266 of file spl.php.

00266 {}

Exception::__toString (  ) 

Returns:
string represenation of exception

Definition at line 327 of file spl.php.

00328     {
00329         return $this->string;
00330     }

Exception::getCode (  )  [final]

Returns:
the code passed to the constructor

Definition at line 293 of file spl.php.

00294     {
00295         return $this->code;
00296     }

Exception::getFile (  )  [final]

Returns:
the name of the file where the exception was thrown

Definition at line 300 of file spl.php.

00301     {
00302         return $this->file;
00303     }

Exception::getLine (  )  [final]

Returns:
the line number where the exception was thrown

Definition at line 307 of file spl.php.

00308     {
00309         return $this->line;
00310     }

Exception::getMessage (  )  [final]

Returns:
the message passed to the constructor

Definition at line 286 of file spl.php.

00287     {
00288         return $this->message;
00289     }

Exception::getTrace (  )  [final]

Returns:
the stack trace as array

Definition at line 314 of file spl.php.

00315     {
00316         return $this->trace;
00317     }

Exception::getTraceAsString (  )  [final]

Returns:
the stack trace as string

Definition at line 321 of file spl.php.

00322     {
00323     }


Member Data Documentation

Exception::$code [protected]

The code passed to the constructor.

Definition at line 253 of file spl.php.

Referenced by __construct().

Exception::$file [protected]

The file name where the exception was instantiated.

Definition at line 256 of file spl.php.

Exception::$line [protected]

The line number where the exception was instantiated.

Definition at line 259 of file spl.php.

Exception::$message [protected]

The exception message.

Definition at line 247 of file spl.php.

Referenced by __construct().

Exception::$string [private]

The string represenations as generated during construction.

Definition at line 250 of file spl.php.

Exception::$trace [private]

The stack trace.

Definition at line 262 of file spl.php.


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 01:05:46 2007 for SPL-StandardPHPLibrary by  doxygen 1.5.2