PHP 8.1.15 Released!

Ds\Deque::first

(PECL ds >= 1.0.0)

Ds\Deque::firstReturns the first value in the deque

Descrição

public Ds\Deque::first(): mixed

Returns the first value in the deque.

Parâmetros

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

Valor Retornado

The first value in the deque.

Erros

UnderflowException if empty.

Exemplos

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

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

O exemplo acima irá imprimir algo similar à:

int(1)
add a note

User Contributed Notes

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