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
 
<ArrayIterator::offsetSetArrayIterator::rewind>
^ArrayIteratorLast updated: Mon, 26 Oct 2026

ArrayIterator::offsetUnset

(PHP 5, PHP 7, PHP 8)

ArrayIterator::offsetUnset — Unset value for an offset

Description

public function ArrayIterator::offsetUnset(mixed $key): void

Unsets a value for an offset.

If iteration is in progress, and ArrayIterator::offsetUnset() is used to unset the current index of iteration, the iteration position will be advanced to the next index. Since the iteration position is also advanced at the end of a foreach loop body, use of ArrayIterator::offsetUnset() inside a foreach loop may result in indices being skipped.

Parameters

key

The offset to unset.

Return Values

No value is returned.

See Also


<ArrayIterator::offsetSetArrayIterator::rewind>
^ArrayIteratorLast updated: Mon, 26 Oct 2026