HH\Lib\C\onlyx

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

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

Returns the first and only element of the given Traversable, or throws if the Traversable is empty

Description

namespace HH\Lib\C;

function onlyx<T>(
  Traversable<T> $traversable,
): T;

For Traversables with more than one element, see C\firstx.

Parameters