HH\Lib\C\last

This API is part of the Hack Standard Library, not HHVM itself.
Facebook Engineer?

This function is available as C\last() in Facebook's www repository.

Returns the last element of the given Traversable, or null if the Traversable is empty

Description

namespace HH\Lib\C;

function last<Tv>(
  Traversable<Tv> $traversable,
): ?Tv;

For non-empty Traversables, see C\lastx. For single-element Traversables, see C\onlyx.

Parameters