Module enums

Source
Available on phper_enum_supported only.
Expand description

APIs related to PHP enum functionality.

This module provides Rust wrappers for PHP enum functionality, allowing you to define and work with PHP enums from Rust code. It supports pure enums, integer-backed enums, and string-backed enums, corresponding to their PHP counterparts.

The implementation respects the PHP 8.1+ enum feature set and provides a type-safe interface for creating enum cases and handling enum values.

Structs§

Enum
The Enum holds zend_class_entry for PHP enum, created by Module::add_enum or EnumEntity::bound_enum.
EnumCase
Represents an enum case within a PHP enum.
EnumEntity
Builder for registering a PHP enum.

Enums§

EnumType
Enum type in PHP.

Traits§

EnumBackingType
Trait representing a backing type for enum values.