Re: String enums & __toString()
| From: | Gina P. Banyard | Date: | Fri, 16 Aug 2024 21:51:05 +0000 |
| Subject: | Re: String enums & __toString() | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124999@lists.php.net to get a copy of this message | ||
On Friday, 16 August 2024 at 22:01, Bilge <bilge@scriptfusion.com> wrote:
> On Fri, 16 Aug 2024, 20:57 John Coggeshall, <john@coggeshall.org> wrote:
>
>> I'm not seeing an obvious upside to forbidding straight out __toString()
>
> I tend to agree, but Crell will drive by in a minute to drop some philosophical nonsense about
> why we're all wrong :^)
If you could avoid disrespecting a contributor to the project, this would be appreciated.
Because I also agree with Larry on this topic that an enumeration is its own type and should not be
coercible to another type.
The reason that you can use a backing value for enumeration is for serialization purposes.
There have been numerous discussion on this list about this topic, with plenty of people stating
their opinions.
Best regards,
Gina P. Banyard
>