Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96883 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52351 invoked from network); 14 Nov 2016 09:20:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2016 09:20:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=joshdifabio@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=joshdifabio@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.43 as permitted sender) X-PHP-List-Original-Sender: joshdifabio@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wm0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:35842] helo=mail-wm0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/61-34859-5E189285 for ; Mon, 14 Nov 2016 04:20:38 -0500 Received: by mail-wm0-f43.google.com with SMTP id g23so86056951wme.1 for ; Mon, 14 Nov 2016 01:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zvCqmHC9MuO8nR6sAXb31jZpv9ORn23UP9StxCSC7ns=; b=PrLw/2pT7ijk5dH6TY3it+2oYm47xzhuaEOcNFmF7Jij8Fo5Ip2LTLtINQ6d1eZnDH DuQNgNKG5Pqz6BZB8Lp2oM8lJzc8CcrDzMiimxoue3p+PRmI9JfHXzaZYotFz/ADg9m2 MDTi9iHd6ib3VSeW5MqUsij+u8xMGDLtU1QBSXAXMKPOPXWbWp6H2OS99ROS+irmzn31 PCilhZFX94csOsJNTqNdkDFmMgbG9Tf0yXlEYJXkff/6VBEnk+oruafZgEWSao618ZVz zcewbT7VN5U3/Gd9D6zslSfJkt0pwla78iqk8NyLDHng4ZHQIM+qC/oF3dXqHhQ1Ulhi mhHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zvCqmHC9MuO8nR6sAXb31jZpv9ORn23UP9StxCSC7ns=; b=AgmLj8ngpYW60j6fokJlysrd7ZAP7jBluV0Pi59qnyWY5O8aO+GbvwTMI9wxKiOlJq RGjpMtNhXoT8FkyviHt603XhDvhYlSJmviMO+VPhMQp3VLB1ulJEAR1Eb+L1u5shQrT9 kAA2xr8X3aqdwy2p73SqCCnc9pozNbbBqvP4PW3BJU4lfzF5UgFrjKAOgzeTNOmIXR/A LbSjEk9d5f7T1Rd+8fYsAQzBTV8BYoejfqcAyzFWVUh/locvP+zUuWV/wA1WocSzLegu hCnqGGcb3ccr1cUS9I04FhyPmROFZ9wjIxUbysalOAF96iuCuz+5g8V6oYQrafYirrXp hitw== X-Gm-Message-State: ABUngvdYRVdpKPQ5mXa5WCTpjZYxt6NlVFQtFpZbS7EzWx+VybgvFTeN4Bkyh64U/3et2UA3lU3fGu1+MbtqPA== X-Received: by 10.194.163.234 with SMTP id yl10mr23361596wjb.112.1479115234230; Mon, 14 Nov 2016 01:20:34 -0800 (PST) MIME-Version: 1.0 References: <0c171a20-c72d-4157-1117-6628a52dd1f0@gmx.de> In-Reply-To: Date: Mon, 14 Nov 2016 09:20:23 +0000 Message-ID: To: =?UTF-8?Q?Micha=C5=82_Brzuchalski?= , Joe Watkins Cc: Levi Morrison , Niklas Keller , "Christoph M. Becker" , PHP Internals List Content-Type: multipart/alternative; boundary=089e01183e0e1e48b205413f5a16 Subject: Re: [PHP-DEV] [RFC][VOTE] Object typehint From: joshdifabio@gmail.com (Josh Di Fabio) --089e01183e0e1e48b205413f5a16 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Nov 14, 2016 at 8:54 AM Micha=C5=82 Brzuchalski wrote: > Hi All, > > Id' like to anounce voting reset - will end in two weeks on 28.11.2016 at > midnight and requires 2/3 majority as previously. > > There were improvements suggested by Joe Watkins and earlier by Nikita > Popov to the patch. > > Those improvements are described on RFC under "Covariance" section > https://wiki.php.net/rfc/object-typehint#covariance This section describes covariance of method arguments. Is this a mistake? Should this be contravariance? Covariant arguments go against LSP. > > It means any `object` typehint or return type can be narrowed to more > specified type (class name) similar to `iterable` pseudo-type but behaves > covariant (more general type can be raplaced with narrowed one). > > P.S. I hope this improvement will bring more positive votes. > > regards, > -- > Micha=C5=82 > > 2016-11-10 13:30 GMT+01:00 Joe Watkins : > > > Levi, > > > > You are assuming it would *need* to be removed :) > > > > Future RFC's must deal with the engine as they find it, as this RFC > > has done. > > > > If it is true that this would prohibit enums being non-objects, and > > I'm not certain that it does, then enums would have to be objects, if > > that's how they find the engine. > > > > If your only concern is about a non-existent feature, then maybe > > you're concern can be alleviated by the non-existent JIT (which does > > partially exist): With a JIT, it doesn't much matter what represents > enums > > anyway. > > > > These are problems for the future, not today. > > > > Cheers > > Joe > > > > On Thu, Nov 10, 2016 at 12:20 PM, Levi Morrison wrote: > > > >> On Thu, Nov 10, 2016 at 5:18 AM, Joe Watkins > >> wrote: > >> > Morning Levi, > >> > > >> >> There is a future compatibility issue of this same type with > `object`: > >> > > >> > If that is an issue, it is for future RFC's to deal with. > >> > > >> > Cheers > >> > Joe > >> > > >> > > >> > On Thu, Nov 10, 2016 at 12:12 PM, Levi Morrison > wrote: > >> >> > >> >> On Thu, Nov 10, 2016 at 2:11 AM, Niklas Keller > wrote: > >> >> > 2016-11-09 21:53 GMT+01:00 Christoph M. Becker >: > >> >> > > >> >> >> On 09.11.2016 at 17:28, Joe Watkins wrote: > >> >> >> > >> >> >> > I want to explain why I voted no on this: > >> >> >> > > >> >> >> > I think it's significantly less useful without variance, > >> variance > >> >> >> > is > >> >> >> > something that is usually difficult to achieve in PHP, but not > for > >> >> >> > this > >> >> >> > feature in particular. > >> >> >> > >> >> >> Can you please elaborate what you mean with variance? I see som= e > >> >> >> practical use cases for covariance of a method with return type > >> object, > >> >> >> but I don't see how contravariance could be achieved for > parameters > >> of > >> >> >> type object. > >> >> >> > >> >> >> If your suggestion is only about invariance of object return > types, > >> I'm > >> >> >> not sure if this very special case would make sense (for > consistency > >> >> >> reasons). > >> >> >> > >> >> > > >> >> > We already have it for iterable -> array. We would have it for al= l > >> other > >> >> > types if there wouldn't be an implementation issue. > >> >> > > >> >> > Regards, Niklas > >> >> > > >> >> > Cheers, > >> >> >> Christoph > >> >> >> > >> >> >> > I absolutely want it, but I want it to be properly useful. > >> >> >> > > >> >> >> > If the RFC were halted and patched to include variance, I'= d > +1 > >> >> >> > it. > >> >> >> > > >> >> >> > Cheers > >> >> >> > Joe > >> >> >> > > >> >> >> > On Sun, Nov 6, 2016 at 5:28 PM, Micha=C5=82 Brzuchalski > >> >> >> > >> >> >> .com> > >> >> >> > wrote: > >> >> >> > > >> >> >> >> Hi everyone, > >> >> >> >> > >> >> >> >> Two weeks have passed since this RFC was put to discussion > here. > >> >> >> >> > >> >> >> >> Therefore, I'm going to put it to a vote for inclusion in PHP > >> 7.2. > >> >> >> >> > >> >> >> >> Voting starts today, 2016-11-06, and will close after two wee= ks > >> on > >> >> >> >> the > >> >> >> >> Sunday 2016-11-20 at midnight. > >> >> >> >> > >> >> >> >> The RFC and voting widget can be found here: > >> >> >> >> https://wiki.php.net/rfc/object-typehint > >> >> >> >> > >> >> >> >> It's a normal 2/3 majority required vote. > >> >> >> >> > >> >> >> >> Thanks! > >> >> >> >> -- > >> >> >> >> regards / pozdrawiam, > >> >> >> >> -- > >> >> >> >> Micha=C5=82 Brzuchalski > >> >> >> >> about.me/brzuchal > >> >> >> >> brzuchalski.com > >> >> >> >> > >> >> >> > > >> >> >> > >> >> >> > >> >> >> -- > >> >> >> PHP Internals - PHP Runtime Development Mailing List > >> >> >> To unsubscribe, visit: http://www.php.net/unsub.php > >> >> >> > >> >> >> > >> >> > >> >> In a return type context `iterable` can be changed to `Traversable` > or > >> >> `array`; it cannot be changed to `Collection` as we cannot guarante= e > >> >> at compile-time that `Collection` implements Traversable. > >> >> > >> >> There is a future compatibility issue of this same type with > `object`: > >> >> right now the only user-definable types are objects. However, enums > >> >> are an often requested feature and they may not be objects. Thus we > >> >> wouldn't be able to guarantee that `Foo` is an object. There is a > >> >> draft RFC with a patch for enums and expect it will come to a > >> >> discussion soon, so I don't think we'll have to wait very long to > know > >> >> the answer here. > >> > > >> > > >> > >> I strongly disagree here; once we add `object` return type covariance > >> it cannot easily be removed. > >> > > > > > > > -- > regards / pozdrawiam, > -- > Micha=C5=82 Brzuchalski > about.me/brzuchal > brzuchalski.com P.S. Apologies for the non-plaintext email. --089e01183e0e1e48b205413f5a16--