Re: [PHP-DEV] Functorial interfaces

2016-05-15 Thread Niklas Keller
2016-05-15 16:21 GMT+02:00 Rasmus Schultz : > > As a downside, you can't implement it in a normal class anymore and just > use > > an instance of that class. > > I see that as a plus, because, as a you said: > > > That's why you call it with the method name of the interface > > Your logic is circu

Re: [PHP-DEV] Functorial interfaces

2016-05-15 Thread Rasmus Schultz
> As a downside, you can't implement it in a normal class anymore and just use > an instance of that class. I see that as a plus, because, as a you said: > That's why you call it with the method name of the interface Your logic is circular - you also said: > As a downside, you can't implement i

Re: [PHP-DEV] Functorial interfaces

2016-05-15 Thread Niklas Keller
2016-05-15 12:05 GMT+02:00 Rasmus Schultz : > I know you're already voting on this, but I'd like to throw in a > couple of late comments. > > My main problem with this RFC is the use of the interface keyword for > something that almost by definition is not an interface. > > An interface is a set o

Re: [PHP-DEV] Functorial interfaces

2016-05-15 Thread Rasmus Schultz
I know you're already voting on this, but I'd like to throw in a couple of late comments. My main problem with this RFC is the use of the interface keyword for something that almost by definition is not an interface. An interface is a set of methods, but an anonymous function is just one function

Re: [PHP-DEV] Functorial interfaces

2016-05-12 Thread Stanislav Malyshev
Hi! > The PHP manual says, regarding Interfaces, that the class implementing > the interface must use the exact same method signatures as are defined > in the interface. Not doing so will result in a fatal error. I think this is mainly for practical reasons - when you compile class Bar, you may n

Re: [PHP-DEV] Functorial interfaces

2016-05-12 Thread Marco Perone
On 12/05/2016 19:02, Rowan Collins wrote: On 12/05/2016 17:47, Andreas Heigl wrote: It's the other way around. The interface creates a contract that ensures that you can use ALL methods available in your SpecialClass. I don't think that's what the interface in the example means: interface Fo

Re: [PHP-DEV] Functorial interfaces

2016-05-12 Thread Rowan Collins
On 12/05/2016 17:47, Andreas Heigl wrote: It's the other way around. The interface creates a contract that ensures that you can use ALL methods available in your SpecialClass. I don't think that's what the interface in the example means: interface Foo { public function foo(SpecialClass $o

Re: [PHP-DEV] Functorial interfaces

2016-05-12 Thread Andreas Heigl
Am 12.05.16 um 18:37 schrieb Marco Perone: > Hi everybody, > I hope this is the right place for asking such a question. If that's not > the case, please excuse me; I'd appreciate if you could redirect me to > the appropriate place. > > The PHP manual says, regarding Interfaces, that the class impl

[PHP-DEV] Functorial interfaces

2016-05-12 Thread Marco Perone
Hi everybody, I hope this is the right place for asking such a question. If that's not the case, please excuse me; I'd appreciate if you could redirect me to the appropriate place. The PHP manual says, regarding Interfaces, that the class implementing the interface must use the exact same met