---
title: "Bitsets & Enumerations"
manual: "TYPO3 Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:enumerations@13.4"
source: "ApiOverview/BitSets/Index.rst"
rendered: "2026-09-18T05:52:58+00:00"
---

# Bitsets & 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@13.4)
-   [How to use bitsets](https://docs.typo3.org/permalink/t3coreapi:how-to-use-bitsets@13.4)

## 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).

> -   *caption:* EXT:my_extension/Classes/MyClass.php (excerpt)

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.
