← All docs

is_subclass_of()

Checks if the object has a given class as one of its parents or implements it.

is_subclass_of()

function is_subclass_of(mixed $object_or_class, string $class, bool $allow_string = true): bool

Checks if the object has a given class as one of its parents or implements it.

Parameters:

  • $object_or_class (mixed)
  • $class (string)
  • $allow_string (bool), default true, optional

Returns: bool

Availability

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

Internals

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