HH\AsyncGenerator::next

Return the Awaitable associated with the next key/value tuple in the async generator, or null.

Description

public function next(): Awaitable<?tuple<Tk,Tv>>

Return the Awaitable associated with the next key/value tuple in the async generator, or null.

You should always await the returned Awaitable to get the actual key/value tuple.

If null is returned, that means you have reached the end of iteration.

You cannot call next() without having the value returned from a previous call to next(), send(), raise(), having first awaited.

Return Values