array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'ds-set.last.php', 1 => 'Ds\\Set::last', 2 => 'Returns the last value in the set', ), 'up' => array ( 0 => 'class.ds-set.php', 1 => 'Ds\\Set', ), 'prev' => array ( 0 => 'ds-set.jsonserialize.php', 1 => 'Ds\\Set::jsonSerialize', ), 'next' => array ( 0 => 'ds-set.map.php', 1 => 'Ds\\Set::map', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/set/last.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Ds\Set::last

(PECL ds >= 1.0.0)

Ds\Set::lastReturns the last value in the set

Beschreibung

public Ds\Set::last(): mixed

Returns the last value in the set.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

The last value in the set.

Fehler/Exceptions

UnderflowException if empty.

Beispiele

Beispiel #1 Ds\Set::last() example

<?php
$set
= new \Ds\Set([1, 2, 3]);
var_dump($set->last());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

int(3)