Re: Enums should implement Stringable interface by default

From: Date: Fri, 28 Feb 2025 16:11:58 +0000
Subject: Re: Enums should implement Stringable interface by default
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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. -- Rowan Tommins [IMSoP]

Thread (4 messages)

« previous php.internals (#126525) next »