HH\class_meth

Like fun, but with the purpose of calling static methods.

Description

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

Like 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

  • string $class The class of the static method to call. Must be a constant string.
  • 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.