Ds\Map::last

(PECL ds >= 1.0.0)

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

Opis

public Ds\Map::last ( void ) : Ds\Pair

Returns the last pair of the map.

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

The last pair of the map.

Błędy/Wyjątki

UnderflowException if empty.

Przykłady

Przykład #1 Ds\Map::last() example

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

Powyższy przykład wyświetli coś podobnego do:

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

User Contributed Notes

There are no user contributed notes for this page.
To Top