Ds\Vector::shift

(PECL ds >= 1.0.0)

Ds\Vector::shiftRemoves and returns the first value

Description

public Ds\Vector::shift ( void ) : mixed

Removes and returns the first value.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

The first value, which was removed.

Erreurs / Exceptions

UnderflowException if empty.

Exemples

Exemple #1 Ds\Vector::shift() example

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

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

L'exemple ci-dessus va afficher quelque chose de similaire à :

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