Documentation

MapIterator extends DelegatingIterator
in package

An iterator that applies a user function to each of its elements.

It is returned by calls to Iterator::map().

Table of Contents

Methods

__construct()  : mixed
Constructs a new MapIterator
current()  : mixed
Return the current (mapped) element.

Methods

__construct()

Constructs a new MapIterator

public __construct( $iterator,  $f) : mixed
Parameters
$iterator :

The iterator containing the values

$f :

The mapping function to apply to the values

current()

Return the current (mapped) element.

public current() : mixed
Return values
mixed

The result of passing the current value of the underlying iterator to the mapping function


        
On this page

Search results