HH\Lib\Keyset\keys

Meta Engineer?

This is available as Keyset\keys in the www repository.

Returns a new keyset containing the keys of the given KeyedTraversable, maintaining the iteration order

namespace HH\Lib\Keyset;

function keys<Tk as arraykey, Tv>(
  KeyedTraversable<Tk, Tv> $traversable,
): keyset<Tk>;

Parameters

Returns

  • keyset<Tk>

Examples

$result = Keyset\keys(dict[1 => 100, 33 => 400 ]);
print_r($result);
//result: keyset[1,33]

$result = Keyset\keys(dict[]);
print_r($result);
//result: keyset[]