Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Iterator::currentIterator::next>
^IteratorLast updated: Mon, 26 Oct 2026

Iterator::key

(PHP 5, PHP 7, PHP 8)

Iterator::key — Return the key of the current element

Description

public function Iterator::key(): mixed

Returns the key of the current element.

Parameters

This function has no parameters.

Return Values

Returns scalar on success, or null on failure.

Errors/Exceptions

Issues E_NOTICE on failure.


<Iterator::currentIterator::next>
^IteratorLast updated: Mon, 26 Oct 2026