Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118046 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16278 invoked from network); 22 Jun 2022 11:16:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2022 11:16:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0B8F918053F for ; Wed, 22 Jun 2022 06:05:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS30827 82.113.144.0/20 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) by php-smtp4.php.net (Postfix) with ESMTP for ; Wed, 22 Jun 2022 06:05:33 -0700 (PDT) Received: from [127.0.0.1] (unknown [85.255.235.139]) by xdebug.org (Postfix) with ESMTPSA id A5B3C10C025; Wed, 22 Jun 2022 14:05:32 +0100 (BST) Date: Wed, 22 Jun 2022 14:05:31 +0100 To: internals@lists.php.net, Nicolas Grekas , PHP Internals List User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <9C11261B-B9D0-4342-81EB-60276B3036E5@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BRFC=5D_=5BUnder_Discussion=5D_Auto-?= =?US-ASCII?Q?implement_Stringable_for_string_backed_enums?= From: derick@php.net (Derick Rethans) On 21 June 2022 23:47:15 BST, Nicolas Grekas wrote: >Hi everyone! > >I'd like to open a discussion on this RFC, to auto-implement Stringable f= or >string-backed enums: >https://wiki=2Ephp=2Enet/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=2E=20 1=2E Enums were introduced to add extra type safety=2E Allowing them to de= grade to simple strings reduces that type safety=2E 2=2E It is not implemented for all enum types, only for string backed ones= =2E This change would now make different classes of enums, without them bei= ng differently inherited classes=2E=20 3=2E The main use case seems to be to prevent having to type ->value, whic= h would otherwise indicate reliably whether an enum is used as string argum= ent=2E=20 I won't be voting in favour of this RFC as it currently stands=2E=20 cheers=20 Derick=20