Returns the first value in the set

Ds\Set::first

(PECL ds >= 1.0.0)

Ds\Set::firstReturns the first value in the set

說明

public Ds\Set::first(): mixed

Returns the first value in the set.

參數

此函式沒有參數。

返回值

The first value in the set.

錯誤/異常

UnderflowException if empty.

範例

示例 #1 Ds\Set::first() example

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

以上例程的輸出類似於:

int(1)

Leave a Reply

Your email address will not be published. Required fields are marked *