Back to index

php5  5.3.10
Classes
Zend engine classes

The classes and interfaces in this group are contained in the c-code of PHP's Zend engine. More...

Classes

class  Exception
 Basic Exception class. More...
interface  ArrayAccess
 Interface to override array access of objects. More...
interface  Traversable
 Interface to detect a class is traversable using foreach. More...
interface  IteratorAggregate
 Interface to create an external Iterator. More...
interface  Iterator
 Basic iterator. More...
interface  Serializable
 Interface for customized serializing. More...

Detailed Description

The classes and interfaces in this group are contained in the c-code of PHP's Zend engine.


Class Documentation

class Exception

Basic Exception class.

Since:
PHP 5.0

Definition at line 258 of file spl.php.

Inheritance diagram for Exception:

Public Member Functions

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

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Private Member Functions

 __clone ()
 Prevent clone.

Private Attributes

 $string
 The string represenations as generated during construction.
 $trace
 The stack trace.

Constructor & Destructor Documentation

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

Construct an exception.

Parameters:
$messageSome text describing the exception
$codeSome code describing the exception

Definition at line 287 of file spl.php.

                                                        {
              if (func_num_args()) {
                     $this->message = $message;
              }
              $this->code = $code;
              $this->file = __FILE__; // of throw clause
              $this->line = __LINE__; // of throw clause
              $this->trace = debug_backtrace();
              $this->string = StringFormat($this);
       }

Here is the call graph for this function:


Member Function Documentation

Exception::__clone ( ) [final, private]

Prevent clone.

Definition at line 280 of file spl.php.

{}
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected]

The exception message.

Definition at line 261 of file spl.php.

Exception::$string [private]

The string represenations as generated during construction.

Definition at line 264 of file spl.php.

Exception::$trace [private]

The stack trace.

Definition at line 276 of file spl.php.

interface ArrayAccess

Interface to override array access of objects.

Since:
PHP 5.0

Definition at line 486 of file spl.php.

Inheritance diagram for ArrayAccess:

Public Member Functions

 offsetSet ($offset, $value)
 offsetGet ($offset)
 offsetUnset ($offset)
 offsetExists ($offset)

Member Function Documentation

Parameters:
$offsetto check
Returns:
whether the offset exists.

Implemented in ArrayIterator, ArrayObject, SplDoublyLinkedList, and DbaArray.

ArrayAccess::offsetGet ( offset)
Parameters:
$offsetto retrieve
Returns:
value at given offset

Implemented in ArrayIterator, ArrayObject, SplDoublyLinkedList, SplObjectStorage, and DbaArray.

ArrayAccess::offsetSet ( offset,
value 
)
Parameters:
$offsetto modify
$valuenew value

Implemented in ArrayIterator, ArrayObject, SplDoublyLinkedList, SplObjectStorage, and DbaArray.

ArrayAccess::offsetUnset ( offset)
Parameters:
$offsetto delete

Implemented in ArrayIterator, ArrayObject, SplDoublyLinkedList, SplObjectStorage, and DbaArray.

interface Traversable

Interface to detect a class is traversable using foreach.

Since:
PHP 5.0

Abstract base interface that cannot be implemented alone. Instead it must be implemented by either IteratorAggregate or Iterator.

Note:
Internal classes that implement this interface can be used in a foreach construct and do not need to implement IteratorAggregate or Iterator.
This is an engine internal interface which cannot be implemented in PHP scripts. Either IteratorAggregate or Iterator must be used instead.

Definition at line 523 of file spl.php.

Inheritance diagram for Traversable:
interface IteratorAggregate

Interface to create an external Iterator.

Since:
PHP 5.0
Note:
This is an engine internal interface.

Definition at line 533 of file spl.php.

Inheritance diagram for IteratorAggregate:
Collaboration diagram for IteratorAggregate:

Public Member Functions

 getIterator ()

Member Function Documentation

Returns:
an Iterator for the implementing object.

Implemented in ArrayObject.

interface Iterator

Basic iterator.

Since:
PHP 5.0

Interface for external iterators or objects that can be iterated themselves internally.

Note:
This is an engine internal interface.

Definition at line 549 of file spl.php.

Inheritance diagram for Iterator:
Collaboration diagram for Iterator:

Public Member Functions

 rewind ()
 Rewind the Iterator to the first element.
 current ()
 Return the current element.
 key ()
 Return the key of the current element.
 next ()
 Move forward to next element.
 valid ()
 Check if there is a current element after calls to rewind() or next().

Member Function Documentation

interface Serializable

Interface for customized serializing.

Since:
5.1

Classes that implement this interface no longer support __sleep() and __wakeup(). The method serialized is called whenever an instance needs to be serialized. This does not invoke __destruct() or has any other side effect unless programmed inside the method. When the data is unserialized the class is known and the appropriate unserialize() method is called as a constructor instead of calling __construct(). If you need to execute the standard constructor you may do so in the method.

Definition at line 595 of file spl.php.

Public Member Functions

 serialize ()
 unserialize ($serialized)

Member Function Documentation

Returns:
string representation of the instance
Serializable::unserialize ( serialized)
Note:
This is a constructor
Parameters:
$serializeddata read from stream to construct the instance