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