HH\class_meth

Like [fun](/hack/reference/function/HH

Description

function class_meth(
  string $class,
  string $method,
)

fun/), but with the purpose of calling static methods.

Example:

<?hh
class C {
  public static function isOdd(int $i): bool { return $i % 2 == 1; }
}
$data = Vector { 1, 2, 3 };
$data->filter(class_meth('C', 'isOdd'));

See also:

Parameters

  • $class The class of the static method to call. Must be a constant string.
  • $method The static method of the class that will be called. Must be a constant string.

Return Values

  • A - callback which will call $method when invoked.