Ds\Vector::first

(PECL ds >= 1.0.0)

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

Descrição

public Ds\Vector::first ( ) : mixed

Returns the first value in the vector.

Parâmetros

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

Valor Retornado

The first value in the vector.

Erros

UnderflowException if empty.

Exemplos

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

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

O exemplo acima irá imprimir algo similar à:

int(1)
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top