Ds\Deque::shift
PHP function
Edit on GitHub ✎
(PECL ds >= 1.0.0)
Removes and returns the first value
Description
Ds\Deque::shift(): mixed
Removes and returns the first value.
Parameters Parameters
Return Values
The first value, which was removed.
Errors/Exceptions
UnderflowException if empty.
Examples
Ds\Deque::shift() example
php
<?php
$deque = new \Ds\Deque(["a", "b", "c"]);
var_dump($deque->shift());
var_dump($deque->shift());
var_dump($deque->shift());
?>The above example will output something similar to:
output
string(1) "a"
string(1) "b"
string(1) "c"