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