class CachingIterator extends CachingIterator implements Countable

internal  
 

Smarter caching iterator.

Properties

bool read-only $first
bool read-only $last
bool read-only $empty
bool read-only $odd
bool read-only $even
int read-only $counter
mixed read-only $nextKey
mixed read-only $nextValue

Methods

__construct(array|Traversable|stdClass|mixed $iterator)

No description

bool
isFirst(int|null $width = null)

Is the current element the first one?

bool
isLast(int|null $width = null)

Is the current element the last one?

bool
isEmpty()

Is the iterator empty?

bool
isOdd()

Is the counter odd?

bool
isEven()

Is the counter even?

int
getCounter()

Returns the counter.

string
__toString()

Returns the counter as string

int
count()

Returns the count of elements.

void
next()

Forwards to the next element.

void
rewind()

Rewinds the Iterator.

mixed
getNextKey()

Returns the next key.

mixed
getNextValue()

Returns the next element.

mixed
__get(string $name)

Returns property value.

bool
__isset(string $name)

Is property defined?

Details

at line 39
__construct(array|Traversable|stdClass|mixed $iterator)

No description

Parameters

array|Traversable|stdClass|mixed $iterator

at line 63
bool isFirst(int|null $width = null)

Is the current element the first one?

Parameters

int|null $width

Return Value

bool

at line 72
bool isLast(int|null $width = null)

Is the current element the last one?

Parameters

int|null $width

Return Value

bool

at line 81
bool isEmpty()

Is the iterator empty?

Return Value

bool

at line 90
bool isOdd()

Is the counter odd?

Return Value

bool

at line 99
bool isEven()

Is the counter even?

Return Value

bool

at line 108
int getCounter()

Returns the counter.

Return Value

int

at line 117
string __toString()

Returns the counter as string

Return Value

string

at line 126
int count()

Returns the count of elements.

Return Value

int

at line 141
void next()

Forwards to the next element.

Return Value

void

at line 153
void rewind()

Rewinds the Iterator.

Return Value

void

at line 164
mixed getNextKey()

Returns the next key.

Return Value

mixed

at line 174
mixed getNextValue()

Returns the next element.

Return Value

mixed

at line 188
mixed __get(string $name)

Returns property value.

Parameters

string $name

Return Value

mixed

Exceptions

LogicException

at line 202
bool __isset(string $name)

Is property defined?

Parameters

string $name

Return Value

bool

Traits

Better OOP experience.