---
title: "Enumerations & bitsets"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:enumerations@11.5"
source: "ApiOverview/Enumerations/Index.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v11 has reached end-of-life as of October 31th 2024 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# Enumerations & bitsets {#enumerations}

-   Use an enumeration, if you have a fixed list of values.
-   Use a bitset, if you have a list of boolean flags.

Do not use PHP constants directly, if your code is meant to be extendable,
as constants cannot be deprecated, but the values of an enumeration or
methods of a bitset can.

-   [How to use enumerations](https://docs.typo3.org/permalink/t3coreapi:how-to-use-enumerations@11.5)
-   [How to use bitsets](https://docs.typo3.org/permalink/t3coreapi:how-to-use-bitsets@11.5)

## Background and history {#background-and-history}

Before version 8.1, PHP had no enumeration concept as part of the language.
Therefore the TYPO3 Core includes a custom enumeration implementation.

In TYPO3, enumerations are implemented by extending the abstract class
`\TYPO3\CMS\Core\Type\Enumeration`. It was originally implemented similar
to `\SplEnum` which is unfortunately part of the unmaintained package
[PECL spl_types](https://pecl.php.net/package/spl_types).

With PHP version 8.1, an enumeration concept was implemented (see the
[Enumeration documentation](https://www.php.net/manual/en/language.enumerations.php) for more details). This makes it possible to drop
the custom enumeration concept from the Core in a future TYPO3 version.
