> > So this breaks the expected behavior of interfaces. > > No it doesn't. It allows interfaces to use contravariance within PHP's > type system, which is different from before, but it doesn't break > anything.
The RFC explicitly states that this is *not* contravariance. And if it's not clear, what I mean by "breaks the expected behavior", is, as far as I understand, what this RFC actually does is it *removes* expected behavior. Correct me if I'm wrong, but really all this RFC does, is remove the requirement that and implementation of an interface be type-hinted? To me, that's "broken". You're favorizing a very, very small number of isolated, valid use-cases - by removing the normal, natural, expected constraint that an implementation be type-hinted as specified by the interface. It's part of the reason interfaces even exist - and this simply ignores that and removes these checks. In my opinion, this will very likely lead to a large number of accidental type-hint omissions - and a very, very small number of actually useful solutions to real problems. In my opinion, we can do much better than that, by adding a mixed type-hint, which will ensure people aren't just accidentally omitting type-hints and instead explicitly opting out of it to achieve parameter widening. Solving this from the start also ensures we can have a clean implementation of real contravariance in the future, without that being a break change. > Rasmus, not answering people's questions and instead saying emotional > stuff suggesting other people have made historically bad decisions > isn't a productive way to conduct a conversation. Okay, I'm emotional, sorry about that. But I think I'm pointing out a real problem and a real possible solution that doesn't make the trade-offs of the current solution. That is, I'm fine with introducing this simplified type of contravariance, but I think it needs to be made explicit - simply omitting a type-hint does not indicate the desired behavior; it doesn't indicate anything, and thereby creates a new problem case of accidental type-hint omission. Is there a very good reason we shouldn't address that, if it's at all possible? On Thu, May 25, 2017 at 12:32 PM, Dan Ackroyd <dan...@basereality.com> wrote: > On 25 May 2017 at 10:21, Rasmus Schultz <ras...@mindplay.dk> wrote: > > > So this breaks the expected behavior of interfaces. > > No it doesn't. It allows interfaces to use contravariance within PHP's > type system, which is different from before, but it doesn't break > anything. > > Niklas Keller wrote: > > The interface will just work correctly, what's the actual problem you're > seeing? > > Rasmus, not answering people's questions and instead saying emotional > stuff suggesting other people have made historically bad decisions > isn't a productive way to conduct a conversation. > > cheers > Dan >