Ds\Set::last
PHP function
Edit on GitHub ✎
(PECL ds >= 1.0.0)
Returns the last value in the set
Description
Ds\Set::last(): mixed
Returns the last value in the set.
Parameters Parameters
Return Values
The last value in the set.
Errors/Exceptions
UnderflowException if empty.
Examples
Ds\Set::last() example
php
<?php
$set = new \Ds\Set([1, 2, 3]);
var_dump($set->last());
?>The above example will output something similar to:
output
int(3)