enum_exists

Checks if the enum has been defined

&reftitle.description; `bool` `enum_exists` `string` `enum` `bool` `autoload`&true;

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

&reftitle.parameters;

`enum`

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

`autoload`

- Whether to autoload if not already loaded.

&reftitle.returnvalues;

Returns &true; if `enum` is a defined enum, &false; otherwise.

&reftitle.examples;

### `enum_exists` example

    <?php
    // Check that the enum exists before trying to use it
    if (enum_exists(Suit::class)) {
        $myclass = Suit::Hearts;
    }
    ?>

&reftitle.seealso;

- `function_exists`
- `class_exists`
- `interface_exists`
- `get_declared_classes`