On 21 June 2022 23:47:15 BST, Nicolas Grekas <nicolas.grekas+...@gmail.com> wrote: >Hi everyone! > >I'd like to open a discussion on this RFC, to auto-implement Stringable for >string-backed enums: >https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums > >I'm looking forward to your feedback,
I am not in favour of this RFC, especially because it is not opt-in. 1. Enums were introduced to add extra type safety. Allowing them to degrade to simple strings reduces that type safety. 2. It is not implemented for all enum types, only for string backed ones. This change would now make different classes of enums, without them being differently inherited classes. 3. The main use case seems to be to prevent having to type ->value, which would otherwise indicate reliably whether an enum is used as string argument. I won't be voting in favour of this RFC as it currently stands. cheers Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php