← All docs

class_exists()

Checks whether the given class has been defined.

class_exists()

function class_exists(string $class, bool $autoload = true): bool

Checks whether the given class has been defined.

Parameters:

  • $class (string)
  • $autoload (bool), default true, optional

Returns: bool

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

Internals

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