array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), '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' => 'en', '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 — Returns the last value in the set
此函数没有参数。
The last value in the set.
UnderflowException if empty.
示例 #1 Ds\Set::last() example
<?php
$set = new \Ds\Set([1, 2, 3]);
var_dump($set->last());
?>
以上示例的输出类似于:
int(3)