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.

Core guidance

Installs
1
GitHub Stars
3
First Seen
Jul 3, 2026
class-constants — anyorgname/php-skills