array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'ds-set.first.php', 1 => 'Ds\\Set::first', ), 'up' => array ( 0 => 'class.ds-set.php', 1 => 'Ds\\Set', ), 'prev' => array ( 0 => 'ds-set.filter.php', 1 => 'Ds\\Set::filter', ), 'next' => array ( 0 => 'ds-set.get.php', 1 => 'Ds\\Set::get', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/set/first.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ds >= 1.0.0)
Ds\Set::first — Returns the first value in the set
Esta función no tiene parámetros.
The first value in the set.
UnderflowException if empty.
Ejemplo #1 Ds\Set::first() example
<?php
$set = new \Ds\Set([1, 2, 3]);
var_dump($set->first());
?>
El resultado del ejemplo sería algo similar a:
int(1)