Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126527 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 8CB921A00BC for ; Fri, 28 Feb 2025 19:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1740771138; bh=YzIl7SyigTMVDFcC5Dq7Lq/+XpDcX3sBdUsNNF09gAU=; h=Date:From:To:In-Reply-To:References:Subject:From; b=j3ToTQHXU3YyhICVKDUyDYr1wUbqQ6WX8AVhKdle6cseGmK9jy6n2P7qZe2rfgXuz 9xkYZZVklCZqdBm1pmwS4BZkhn54D0bsvCTcNvbPG+fzBCbu9ZXrCMVsQqRmzkrwVZ c7vUZXYHRTcFk0NTg+r9mHlYExwiGdDNtA+qIpmNq2MXlHOFtd61rDC0weVbu20b+S Ce2J8+muIs6cxdYLYere62Tp2u49STqOpBw1wGKEoNiNWcsWUSFEBVSqRIXH4jElnr B3Hpf3rcImJzAuuIDNgk5KCr6TCJQt3opeapLTpaDcNs4q82XiG7VmzYqRRc2dsBtr 1cuMKQkl/yc/w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3DFC418007F for ; Fri, 28 Feb 2025 19:32:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-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,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 28 Feb 2025 19:32:16 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id D78151380F0D for ; Fri, 28 Feb 2025 14:34:53 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-04.internal (MEProxy); Fri, 28 Feb 2025 14:34:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1740771293; x=1740857693; bh=Os8ncrHsgCzu3J4fDxQdU S5YK6L6502zbdtqkIWTML4=; b=fdnMrmX7PQJP26H42TmjkxA3EzXV34AblnKtp 6l8zKyGk1MUHwozgTBlR0/qfBJsUpFzC4K3GzFpic8cmsKfONUccOM9yZWT9VCy/ iUZ5Ennqr9M5M+uMn8UH4y2ofShN8ccrylFjrtcpHQMR/okh4qplTb/UBMj6AP/Q jEzoukBlqqgjrjGpKbBlM0ZjUh5sIQjdbM+qFTGSGouv/laMc4P4dNTzRt42X8Ed jJ1OiwDunMQ8VP+yxdpIUyi9YWNYrVW940O1QC9O2nsIPTdY2uKNNKQTUM6UMCXp R3ZMvxWKdDypwHi9s6iBYXoI8QMt4HfqhEnJL2dUtYUtyCbCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1740771293; x=1740857693; bh=O s8ncrHsgCzu3J4fDxQdUS5YK6L6502zbdtqkIWTML4=; b=SlVYga8B8dcq256yZ qisULmn0PiIbu+dvKghxxcSUNJXiFeHqyzg2T1Z0+Q4awCmli5/aAtFRdPf+l3Is asl00XpTWo9xWyrEi9IA+EKNbU5aRt3vXH1dZZ8RsFZwVgnY7Dza/OnG0IUnvMHa o/5dH/fXC5Z2tOV/I5JLqqVXGvPwbmwpSFIMfrpiVlS9YsEj/kBwo1TtsO3+SwpO ci2Oi1SwaKl4DOtVNvQHpD/Ny/EbATgxr76LKTh+n/amkPjqLKbtTWpnan6J1qA8 merzGqYMJ9rwzMYOHVVFA84WluaAccB39lYSv2CF8qyX3WVziT6nEMnAUuSEHhuV 7moAw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeluddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtjeertdertddt necuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfh hivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhephfdugedutddvudefvddv ffffgffgffetfeeuieeileeltdfgfeeljeejieeiteeunecuffhomhgrihhnpegvgihtvg hrnhgrlhhsrdhiohdpphgvrghkugdrtghomhenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep ihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 7C63429C006F; Fri, 28 Feb 2025 14:34:53 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 28 Feb 2025 13:34:33 -0600 To: "php internals" Message-ID: In-Reply-To: <3b7b3e08-7b69-4c91-8ae8-537a2fae5785@rwec.co.uk> References: <3b7b3e08-7b69-4c91-8ae8-537a2fae5785@rwec.co.uk> Subject: Re: [PHP-DEV] Enums should implement Stringable interface by default Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Fri, Feb 28, 2025, at 10:11 AM, Rowan Tommins [IMSoP] wrote: > On 28/02/2025 08:33, Janis Kajaks wrote: >> My suggestion is that all enums (both basic/pure and backed) should >> implement Stringable interface by default, > > > This has come up at least twice before: > > * https://externals.io/message/118040 > * https://externals.io/message/124991 > > These threads also touch on some of the same issues: > > * https://externals.io/message/120121 > * https://externals.io/message/123388 > > Fundamentally, there are different schools of thought on what an "enum" > should be, which lead to different sets of features. > > I think some of those differences are fundamental enough that you could > only have both if the language had multiple enum-like things which the > user could choose between. Also see: https://peakd.com/hive-168588/@crell/on-the-use-of-enums Not auto-implementing Stringable was a deliberate design decision, for reasons that have not changed. --Larry Garfield