class_exists

PHP 4, PHP 5, PHP 7, PHP 8
class_exists - Checks if the class has been defined
Manual
Code Examples

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

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

Parameters

class

The class name. The name is matched in a case-insensitive manner.

autoload

Whether to call __autoload by default.

Return Values

Returns true if class is a defined class, false otherwise.

Related Functions

Example of class_exists

Show all examples for class_exists

PHP Version:


Function class_exists:

Class/Object Information Functions

Most used PHP functions