Ds\Sequence::first

Returns the first value in the sequence

説明

abstract public mixed Ds\Sequence::first()

Returns the first value in the sequence.

パラメータ

この関数にはパラメータはありません。

戻り値

The first value in the sequence.

エラー / 例外

UnderflowException if empty.

例1 Ds\Sequence::first example

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

上の例の出力は、 たとえば以下のようになります。

int(1)