class-constants
Installation
SKILL.md
Class Constants
When to use
- The user needs a named, compile-time constant value bound to a class or interface.
- The user wants several classes to share the same constant values via an interface or base class.
- The user needs a fixed set of named values but targets PHP 7.4 or 8.0 where enums do not exist.
When NOT to use
- Do not model a closed set of related values with class constants when the runtime is PHP 8.1+ and an enum would fit.
- Do not use class constants for values that vary by environment or must change at runtime.