On 31/03/2021 19:44, Olle Härstedt wrote:
enum Result: mixed { case Ok = null; case Error = null; }
Sounds like what you're looking for is not "pure" enums, but Algebraic Data Types. Larry and Ilija have a grand plan for adding those, but there's a few steps to go yet: https://wiki.php.net/rfc/adts
The current enum values are just constants for simplifying serialization and lookup (translating to a code or database ID).
Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php