SPL-StandardPHPLibrary
Public Member Functions | List of all members
EmptyIterator Class Reference
Inheritance diagram for EmptyIterator:
Inheritance graph
Collaboration diagram for EmptyIterator:
Collaboration graph

Public Member Functions

 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Detailed Description

An empty Iterator.

Author
Marcus Boerger
Version
1.0
Since
PHP 5.1

Definition at line 18 of file emptyiterator.inc.

Member Function Documentation

EmptyIterator::current ( )

This function must not be called.

It throws an exception upon access.

Exceptions
Exception
Returns
void

Implements Iterator.

Definition at line 39 of file emptyiterator.inc.

40  {
41  throw new Exception('Accessing the value of an EmptyIterator');
42  }
Basic Exception class.
Definition: spl.php:258
EmptyIterator::key ( )

This function must not be called.

It throws an exception upon access.

Exceptions
Exception
Returns
void

Implements Iterator.

Definition at line 48 of file emptyiterator.inc.

49  {
50  throw new Exception('Accessing the key of an EmptyIterator');
51  }
Basic Exception class.
Definition: spl.php:258
EmptyIterator::next ( )

No operation.

Returns
void

Implements Iterator.

Definition at line 56 of file emptyiterator.inc.

57  {
58  // nothing to do
59  }
EmptyIterator::rewind ( )

No operation.

Returns
void

Implements Iterator.

Definition at line 23 of file emptyiterator.inc.

24  {
25  // nothing to do
26  }
EmptyIterator::valid ( )
Returns
false

Implements Iterator.

Definition at line 30 of file emptyiterator.inc.

31  {
32  return false;
33  }

The documentation for this class was generated from the following file: