Ds\Deque::shift
(PECL ds >= 1.0.0)
Ds\Deque::shift — Removes and returns the first value
參數
此函式沒有參數。
返回值
The first value, which was removed.
錯誤/異常
UnderflowException if empty.
範例
示例 #1 Ds\Deque::shift() example
<?php
$deque = new \Ds\Deque(["a", "b", "c"]);
var_dump($deque->shift());
var_dump($deque->shift());
var_dump($deque->shift());
?>
以上例程的輸出類似於:
string(1) "a" string(1) "b" string(1) "c"