array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'ds-set.last.php', 1 => 'Ds\\Set::last', ), '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.merge.php', 1 => 'Ds\\Set::merge', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'pt_BR', 'path' => 'reference/ds/ds/set/last.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ds >= 1.0.0)
Ds\Set::last — Retorna o último valor no conjunto
Esta função não possui parâmetros.
O último valor no conjunto.
UnderflowException se vazio.
Exemplo #1 Exemplo de Ds\Set::last()
<?php
$set = new \Ds\Set([1, 2, 3]);
var_dump($set->last());
?>
O exemplo acima produzirá algo semelhante a:
int(3)