Re: [RFC] [Discussion] Stringable Enums

From: Date: Fri, 05 Dec 2025 00:32:01 +0000
Subject: Re: [RFC] [Discussion] Stringable Enums
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-129559@lists.php.net to get a copy of this message
Hey Larry, On 5.12.2025 01:21:43, Larry Garfield wrote:
I've long argued against allowing __toString() for reasons others have already covered, so I won't bother repeating it. But off hand I don't see why __debugInfo() would cause a problem. I am not sure it's useful before ADTs happen, but I don't think it would cause any harm?
I found to semi-commonly (the ergonomics of querying are bad) add attributes to enum cases. A __debugInfo() handler could provide information about all attached metadata. Bob

« previous php.internals (#129559) next »