Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118109 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11704 invoked from network); 27 Jun 2022 15:04:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2022 15:04:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B36DF180543 for ; Mon, 27 Jun 2022 09:55:14 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 27 Jun 2022 09:55:14 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D99303200914 for ; Mon, 27 Jun 2022 12:55:12 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Mon, 27 Jun 2022 12:55:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1656348912; x= 1656435312; bh=MIS2kxNUmFFgeZTvpI+ySJr0rFiWWTduWnJzaMcV9Gg=; b=F k82WCd2VA5VfCzX+15cURrItbujmiAvYBouq94loK/dLST+JOwa8IyNnhmWzG3xa QedQfAXf6aPb4m3XpvHYs9az4cjGNUjBO5/f/FONLD2V2OqA25re+h4FmhHZsh2e lapfjAYkksoxX6AA8leqIpm0hBoG5wtegy+/LGmHwU3yk0bE60YRmeHesInzbEtR 0zuE19X3RIawnpus0RAlBBjSqpEhn3kiLlsu1HBRymeNUbmwex+uyBTG3FzzJmVO p9SYagPVVNFeZtmHcMBs7AUaoTX7HSBHo5PbjZZcCUgLuYCtkt92AraciB12XrrZ y2DQjueXJt8Lv6nv9TCdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1656348912; x=1656435312; bh=MIS2kxNUmFFgeZTvpI+ySJr0rFiW WTduWnJzaMcV9Gg=; b=Zbu5DZqkBmtcHbD9plli61P++uuqOnm9QE9/XL3HMSgC vMS+HAAAXaqpNWflRfVrkE+5LOtUShkJnkKJj9ms7GuOO/TiIqIPn0flVAErwg58 PHTYUfBGTgl6eudRyqZvla4l+NnQUkEqO9bI00nlhN4wKFdfNOiQOSQiufCMF5YJ 7tdVZ4STlhpsJdc1v/jq+d003YMQopgAQu0VY9ve4PjwkowWPzGY/DBeQlqZfupu mIGQAxtJm3FbQF3E6D7PsRTZzxkBU6nPZNpoHFL90Ol5AriwJhB6IJ6g9x6hn3hc drCfeekQRDTma48nzvGqg/8AU3wv8V636d6UKuo7jw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeghedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepjeelgfdvgeekuedtffdvgeeigeeuteffjeeukedv ueevieefuedulefgudetfefgnecuffhomhgrihhnpehpvggrkhgurdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgr rhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 16EEE1700077; Mon, 27 Jun 2022 12:55:12 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-713-g1f035dc716-fm-20220617.001-g1f035dc7 Mime-Version: 1.0 Message-ID: In-Reply-To: <2cee17c0-7b77-4709-94b9-598a4c3d1f49@www.fastmail.com> References: <9C11261B-B9D0-4342-81EB-60276B3036E5@php.net> <2cee17c0-7b77-4709-94b9-598a4c3d1f49@www.fastmail.com> Date: Mon, 27 Jun 2022 11:54:51 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jun 22, 2022, at 12:26 PM, Larry Garfield wrote: > So I am firmly against making it easier to (mis)use enums in a > situation where constants are already the superior solution by every > metric. The only argument I see is making case 1, transitioning from a > string to an enum for a genuinely limited-case, easier. But in that > case, the transition is going to have to happen eventually anyway, and > that means the type is going to change at some point, and the same BC > issue will appear, just at a different time. Unless the intent is to > then never change the type and keep the function incorrectly typed > (from the POV that it's logically an enum, even though string typed was > the best/correct type for years) forever, in which case... use a set of > constants. > > --Larry Garfield As promised, a blog post on the topic that folks are welcome to link to when telling people no: https://peakd.com/hive-168588/@crell/on-the-use-of-enums --Larry Garfield