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