HH\Lib\C\contains_key

Requires the Hack Standard Library to be installed.
Facebook Engineer?

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

Returns true if the given KeyedContainer contains the key

namespace HH\Lib\C;

function contains_key<Tk1 as arraykey, Tk2 as arraykey, Tv>(
  KeyedContainer<Tk1, Tv> $container,
  Tk2 $key,
): bool;

Time complexity: O(1) Space complexity: O(1)

Parameters

Returns

  • bool