Re: [RFC][DISCUSSION] Object type hint, now with added variance

From: Date: Tue, 14 Feb 2017 21:14:43 +0000
Subject: Re: [RFC][DISCUSSION] Object type hint, now with added variance
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-98293@lists.php.net to get a copy of this message
On Tue, Feb 14, 2017 at 11:55 AM, Dan Ackroyd <danack@basereality.com> wrote: > Hi Levi, > > On 24 November 2016 at 08:58, Dan Ackroyd <danack@basereality.com> wrote: >> Hi Levi, >> >> On 23 November 2016 at 01:25, Levi Morrison <levim@php.net> wrote: >> >>> For instance enumerations (or enums) are one possible type I can see us >>> adding that may not be objects. >> >> I very much look forward to the RFC for enums, and have for some time. >> When are you thinking of submitting it for discussion and voting? > > I can understand your concerns. At the same time, I hope you can > understand that people won't want to put off introducing features that > they want in the meantime. > > I think if you were able to give a timeline for when an Enum RFC could > be introduced, before the PHP 7.2 release, we could talk about whether > it would be right to hold off on this RFC for now. > > Otherwise I suggest Michał updates the voting options, and we open the > voting in a week or so. > > cheers > Dan Let me clarify that I'm not against this object variance; there is nothing intrinsic about object variance that prevents enums (or typedefs/type aliases). Rather it's *how* it is achieving that variance that is an issue. This is something that should ship along with full covariance/contravariance and not be a special case which may unintended side-effects later (such as preventing enums without breaking BC). Does that make sense?

« previous php.internals (#98293) next »