Ds\Set::first
(PECL ds >= 1.0.0)
Ds \ Set :: first - 返回集合中的第一个值。
描述
public void Ds\Set::first ( void )
返回集合中的第一个值。
参数
该功能没有参数。
返回值
集合中的第一个值。
错误/异常
如果为空则为UnderflowException。
例子
示例#1 Ds \ Set :: first()示例
<?php
$set = new \Ds\Set([1, 2, 3]);
var_dump($set->first());
?>
上面的例子会输出类似于:
int(1)
← Ds\Set::filter
Ds\Set::get →
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com