phpday 2027 - Call for Papers

CachingIterator::key

(PHP 5, PHP 7, PHP 8)

CachingIterator::key — Return the key for the current element

说明

public function CachingIterator::key(): mixed

Returns the key of the current element.

As the CachingIterator is one element ahead of its inner iterator, this is the key that was stored when the iterator last moved, not the current key of the inner iterator.

参数

此函数没有参数。

返回值

Returns the key of the current element, or null if the iterator is not valid.

参见

+添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top