array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'ds-map.skip.php', 1 => 'Ds\\Map::skip', 2 => 'Returns the pair at a given positional index', ), 'up' => array ( 0 => 'class.ds-map.php', 1 => 'Ds\\Map', ), 'prev' => array ( 0 => 'ds-map.reversed.php', 1 => 'Ds\\Map::reversed', ), 'next' => array ( 0 => 'ds-map.slice.php', 1 => 'Ds\\Map::slice', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/map/skip.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Ds\Map::skip

(PECL ds >= 1.0.0)

Ds\Map::skipReturns the pair at a given positional index

Beschreibung

public Ds\Map::skip(int $position): Ds\Pair

Returns the pair at a given zero-based position.

Parameter-Liste

position

The zero-based positional index to return.

Rückgabewerte

Returns the Ds\Pair at the given position.

Fehler/Exceptions

OutOfRangeException if the position is not valid.

Beispiele

Beispiel #1 Ds\Map::skip() example

<?php
$map
= new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);

var_dump($map->skip(1));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

object(Ds\Pair)#2 (2) {
  ["key"]=>
  string(1) "b"
  ["value"]=>
  int(2)
}