Ds\Vector::first

(PECL ds >= 1.0.0)

Ds\Vector::firstReturns the first value in the vector

Description

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

Returns the first value in the vector.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

The first value in the vector.

Erreurs / Exceptions

UnderflowException if empty.

Exemples

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

<?php
$vector 
= new \Ds\Vector([123]);
var_dump($vector->first());
?>

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

int(1)