Re: [RFC] Deprecate Fuzzy Type Casts and Allow Stringable in Strict Mode
| From: | Alexandre Daubois | Date: | Fri, 23 Jan 2026 17:06:23 +0000 |
| Subject: | Re: [RFC] Deprecate Fuzzy Type Casts and Allow Stringable in Strict Mode | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129904@lists.php.net to get a copy of this message | ||
Hi Larry,
Le ven. 23 janv. 2026 à 17:06, Larry Garfield <larry@garfieldtech.com> a écrit :
> 1. This really feels like two separate RFCs. I'd rather see them as two separate RFCs
> than one mixed RFC.
Indeed, we'll be working on separating the RFCs. Let's consider this
one as the fuzzy casts one, and the soon-to-be-created RFC will only
talk about Stringable.
> 2. I tend to agree with other commenters that we should leave the existing casts alone, and
> instead add a new, more reasonable type conversion operators (for some definition of reasonable).
I shared my point of view about this solution in my responses to
others. Don't hesitate if something's unclear or bothers you!
> 3. Unlike the other commenters, I am 100% in favor of allowing
>
string to accept Stringable in strict mode. Strict mode basically
> broke Stringable, and that's been an annoyance for a long time. I know some feel that
> Stringable is always and forever a bad thing, amen, but I don't agree. It has ample valid use
> cases, even if it can be abused. I want my Stringable objects back! :-)
Let's work for that!
— Alexandre Daubois