On 30.12.2020 21:21, Larry Garfield wrote: >> enum Suit { >> case Hearts = 'H'; >> case Diamonds = 'D'; >> case Clubs = 'C'; >> case Spades = 'S'; >> } >> >> 'H' === Suit::Hearts->value; // true >> 'Hearts' === Suit::Hearts->value; // false > > That's a possibility we've been kicking around. I'm considering it, Ilija > doesn't care for it. :-) What's your argument in favor?
My argument is that, from an end-user perspective, I don't really see why Unit and Scalar enums have to have different "API" at this point. I'm talking about ":string"/":int" in the enum definiton as well as ->value and ->from(). -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php