• PHP Video Tutorials

PHP - Ds Sequence first() Function


Advertisements

Ds\Sequence::first() function can return the first value in a sequence.

Syntax

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

Ds\Sequence::first() function doesn't have any parameters and can return the first value in a sequence.

Ds\Sequence::first() function can throw UnderflowException if empty.

Example

<?php
   $seq = new \Ds\Vector([1, 2, 3, 4, 5]);
   var_dump($seq->first());
?>
php_function_reference.htm
Advertisements