StreamManager  latest
PHP stream manager
Iterator Interface Reference

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

Public Member Functions

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

Detailed Description

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

See also
http://php.net/class.iterator.php

Definition at line 11 of file Iterator.php.

Member Function Documentation

Iterator::current ( )

Returns the current element.

Return values
mixedCurrent element.
See also
http://php.net/iterator.current.php
Iterator::key ( )

Returns the key of the current element.

Return values
scalarReturns scalar on success, or null on failure.
Note
Issues E_NOTICE on failure.
See also
http://php.net/iterator.key.php
Iterator::next ( )

Moves the current position to the next element.

Note
This method is called after each foreach loop.
See also
http://php.net/iterator.next.php
Iterator::rewind ( )

Rewinds back to the first element of the Iterator.

Note
This is the first method called when starting a foreach loop. It will not be executed after foreach loops.
See also
http://php.net/iterator.rewind.php
Iterator::valid ( )

Checks if current position is valid.

This method is called after Iterator::rewind() and Iterator::next() to check if the current position is valid.

Return values
booltrue if the current position is valid, false otherwise.
Note
If Iterator::valid() returns false, the foreach loop will be terminated.
See also
http://php.net/iterator.valid.php

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