Sequence
PHP Manual

Ds\Sequence::shift

(PECL ds >= 1.0.0)

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

Descrierea

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

Removes and returns the first value.

Parametri

Această funcție nu are parametri.

Valorile întoarse

The first value, which was removed.

Erori/Excepții

UnderflowException if empty.

Exemple

Example #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());
?>

Exemplul de mai sus va afișa ceva similar cu:

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

Sequence
PHP Manual