SPL-StandardPHPLibrary
emptyiterator.inc
Go to the documentation of this file.
1 <?php
2 
18 class EmptyIterator implements Iterator
19 {
23  function rewind()
24  {
25  // nothing to do
26  }
27 
30  function valid()
31  {
32  return false;
33  }
34 
39  function current()
40  {
41  throw new Exception('Accessing the value of an EmptyIterator');
42  }
43 
48  function key()
49  {
50  throw new Exception('Accessing the key of an EmptyIterator');
51  }
52 
56  function next()
57  {
58  // nothing to do
59  }
60 }
61 
62 ?>
rewind()
No operation.
key()
This function must not be called.
An empty Iterator.
current()
This function must not be called.
Basic iterator.
Definition: spl.php:549
next()
No operation.
Basic Exception class.
Definition: spl.php:258