class RepeatedFieldIter implements Iterator (View source)

RepeatedFieldIter is used to iterate RepeatedField. It is also need for the foreach syntax.

Methods

__construct($container)

Create iterator instance for RepeatedField.

void
rewind()

Reset the status of the iterator

object
current()

Return the element at the current position.

int
key()

Return the current position.

void
next()

Move to the next position.

bool
valid()

Check whether there are more elements to iterate.

Details

__construct($container)

Create iterator instance for RepeatedField.

Parameters

$container

void rewind()

Reset the status of the iterator

need to add return type void (require update php version to 7.1)

Return Value

void

object current()

Return the element at the current position.

need to add return type mixed (require update php version to 8.0)

Return Value

object

The element at the current position.

int key()

Return the current position.

need to add return type mixed (require update php version to 8.0)

Return Value

int

The current position.

void next()

Move to the next position.

need to add return type void (require update php version to 7.1)

Return Value

void

bool valid()

Check whether there are more elements to iterate.

Return Value

bool

True if there are more elements to iterate.