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