Ds\Sequence::pop

(PECL ds >= 1.0.0)

Ds\Sequence::popRemoves and returns the last value

說(shuō)明

abstract public Ds\Sequence::pop(): mixed

Removes and returns the last value.

參數(shù)

此函數(shù)沒(méi)有參數(shù)。

返回值

The removed last value.

錯(cuò)誤/異常

UnderflowException if empty.

范例

示例 #1 Ds\Sequence::pop() example

<?php
$sequence 
= new \Ds\Vector([123]);

var_dump($sequence->pop());
var_dump($sequence->pop());
var_dump($sequence->pop());
?>

以上例程的輸出類(lèi)似于:

int(3)
int(2)
int(1)