PHP 8.1.24 Released!

Ds\Set::first

(PECL ds >= 1.0.0)

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

Descrição

public Ds\Set::first(): mixed

Returns the first value in the set.

Parâmetros

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

Valor Retornado

The first value in the set.

Erros

UnderflowException if empty.

Exemplos

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

<?php
$set
= new \Ds\Set([1, 2, 3]);
var_dump($set->first());
?>

O exemplo acima produzirá algo semelhante a:

int(1)
add a note

User Contributed Notes

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