Ds\Map::last

(PECL ds >= 1.0.0)

Ds\Map::lastReturns the last pair of the map

Açıklama

publicDs\Map::last(): Ds\Pair

Returns the last pair of the map.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

The last pair of the map.

Hatalar/İstisnalar

UnderflowException if empty.

Örnekler

Örnek 1 Ds\Map::last() example

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

Yukarıdaki örnek şuna benzer bir çıktı üretir:

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