Re: Pre-RFC proposal: opt-in implicit interfaces / structural typing
On 07/11/2025 17:05, Spencer Malone wrote:
Hey all! Long time browser, first time emailer. I wanted to start a pre-RFC discussion on the proposal of opt-in implicit interfaces / structural typing / "golang style interfaces".
Hi and welcome :)
In general, I prefer explicit code over implicit, so wouldn't be an enthusiastic supporter of this (although I might abstain rather than voting against).
However, I though it worth mentioning that PHP has one implicit interface already: any class with an __toString() method magically implements Stringable. I've never really understood why, or why that interface even exists; but at least having a general concept of "implicit interface" would make it less magical.
--
Rowan Tommins
[IMSoP]
Thread (12 messages)