PHP Conference China 2020

Ds\Sequence::last

(PECL ds >= 1.0.0)

Ds\Sequence::lastReturns the last value

Descrição

abstract public Ds\Sequence::last ( void ) : mixed

Returns the last value in the sequence.

Parâmetros

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

Valor Retornado

The last value in the sequence.

Erros

UnderflowException if empty.

Exemplos

Exemplo #1 Ds\Sequence::last() example

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

O exemplo acima irá imprimir algo similar à:

int(3)
add a note add a note

User Contributed Notes

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