HH\Lib\C\last

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

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

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