> On Jan 27, 2020, at 10:55 AM, Larry Garfield <la...@garfieldtech.com> wrote:
> 
> On Mon, Jan 27, 2020, at 10:19 AM, Nikita Popov wrote:
>> Automatically implementing interfaces based on implemented methods could
>> also be a general language feature (see Go interfaces for example), but
>> likely not one we're interested in having in it's full generality. In this
>> particular case, it seems useful though.
>> 
>> Regards,
>> Nikita
> 
> I believe Anthony Ferrara proposed "Weak interfaces" once many years ago, 
> which is essentially what you're describing.  It didn't get much traction 
> although I'm unclear why.  (Possibly just less familiarity with Go at the 
> time?)
> 
> I agree not all interfaces should be implicit, but having 
> implicitly-implementable interfaces does sound generally useful.  That 
> shouldn't block this RFC, but might this RFC be a model for how to implement 
> such things more generically in the future?
> 
> --Larry Garfield

Glad to see you picked up on this Larry.

I don't think "Weak Interfaces" became an RFC unless Google is failing me, but 
I found a reference to it being on the mailing list from Matthieu Napoli's 
article on GitHub about decoupling, which is worth a read:

https://github.com/mnapoli/mnapoli.github.io/blob/master/articles/decoupling-packages.md

As far as Go's implicit interfaces, I have found that to be one of the most 
compelling language features of Go, and would be ecstatic if we could find a 
way to support implicit interfaces in PHP.

-Mike

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to