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