Sequence
PHP Manual

Ds\Sequence::shift

(PECL ds >= 1.0.0)

Ds\Sequence::shiftRemoves and returns the first value.

Descrição

abstract public mixed Ds\Sequence::shift ( void )

Removes and returns the first value.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

The first value, which was removed.

Erros

UnderflowException if empty.

Exemplos

Exemplo #1 Ds\Sequence::shift() example

<?php
$sequence 
= new \Ds\Vector(["a""b""c"]);

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

O exemplo acima irá imprimir algo similar à:

string(1) "a"
string(1) "b"
string(1) "c"

Sequence
PHP Manual