Home > PHP > Function > Classes/Objects > class_exists()

class_exists()

class_exists - Checks if the class has been defined

Syntax

bool class_exists (string $class_name, bool $autoload)

Arguments

  • class_name - The class name. The name is matched in a case-insensitive manner.
  • autoload - Whether or not to call __autoloadby default.

Description

This function checks whether or not the given class has been defined.

Version

PHP 4, 5

Return value

Returns TRUE if class_name is a defined class, FALSE otherwise.