← All docs

method_exists()

Checks whether a class method exists.

method_exists()

function method_exists(mixed $object_or_class, string $method): bool

Checks whether a class method exists.

Parameters:

  • $object_or_class (mixed)
  • $method (string)

Returns: bool

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how method_exists is implemented in the compiler, see the internals page.