The myclabs/php-enum library is a PHP package that provides an object-oriented approach to implementing enumerations, inspired by the SPL's SplEnum. Before PHP 8.1 introduced native enum support, this library offered a structured way to define and use enumerated types, enhancing code readability and type safety. By extending the base Enum class, developers can create enums with defined constants, ensuring that variables only hold valid, predefined values. This approach helps prevent errors related to invalid values and makes the codebase more maintainable.

Features

  • Define enumerated types by extending the base Enum class
  • Access enum values using static methods corresponding to constant names
  • Validate values against the defined set of enum constants
  • Retrieve all possible enum values and keys as arrays
  • Compare enum instances for equality using the equals() method
  • Serialize enum instances to JSON for data interchange

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow PHP Enum

PHP Enum Web Site

Other Useful Business Software
Attack Surface Management | Criminal IP ASM Icon
Attack Surface Management | Criminal IP ASM

For security operations, threat-intelligence and risk teams wanting a tool to get access to auto-monitored assets exposed to attack surfaces

Criminal IP’s Attack Surface Management (ASM) is a threat-intelligence–driven platform that continuously discovers, inventories, and monitors every internet-connected asset associated with an organization, including shadow and forgotten resources, so teams see their true external footprint from an attacker’s perspective. The solution combines automated asset discovery with OSINT techniques, AI enrichment and advanced threat intelligence to surface exposed hosts, domains, cloud services, IoT endpoints and other Internet-facing vectors, capture evidence (screenshots and metadata), and correlate findings to known exploitability and attacker tradecraft. ASM prioritizes exposures by business context and risk, highlights vulnerable components and misconfigurations, and provides real-time alerts and dashboards to speed investigation and remediation.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of PHP Enum!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Libraries

Registered

2025-05-15