자료구조 Ds\Set::last
(PECL ds >= 1.0.0)
Ds\Set::last — 집합의 마지막 값을 반환
설명
public Ds\Set::last(): mixed
집합의 마지막 값을 반환합니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
집합의 마지막 값입니다.
오류/예외
비어 있으면 UnderflowException이 발생합니다.
Examples
예제 #1 Ds\Set::last() 예제
<?php
$set = new \Ds\Set([1, 2, 3]);
var_dump($set->last());
?>
위의 예는 다음과 유사한 결과를 출력합니다.
int(3)