π Enum
What are Enums?
<?php
enum UserRole: string
{
case ADMIN = 'admin';
case EDITOR = 'editor';
case VIEWER = 'viewer';
}$userRole = UserRole::ADMIN;
if ($userRole === UserRole::EDITOR) {
echo 'User is an editor';
}Defining Enums in Maginium
Enum Methods
Enum Reflection
Enums in Database
Last updated