Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96813 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45222 invoked from network); 10 Nov 2016 12:12:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2016 12:12:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.176 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.176 mail-yb0-f176.google.com Received: from [209.85.213.176] ([209.85.213.176:36446] helo=mail-yb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/B1-15787-63464285 for ; Thu, 10 Nov 2016 07:12:39 -0500 Received: by mail-yb0-f176.google.com with SMTP id v78so87871322ybe.3 for ; Thu, 10 Nov 2016 04:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=NC41O/n13DCYNM/lLsGNXAacEcjdBJ1LsF2Nrsq3/8A=; b=q9IDwURbqlywyujJeH8cL+9OlIHByQ87uxxnYPP8nrFVZ0tAXR++ZwexRXdbuL1/+A C/jB7x4TzWqulKk9pNr7AaAXyf06B65g4JgyYoSeAv9t/lsmJ5rUB+9yJQpTs2kxPty3 m1rgp8xlRx2V7v/8deGVabIVcBF5ic8s6KB0Cit39kZENFaJLlBkf/nIp/1Bqs3nn4O/ 81snLYHIyeu1Q4EHPseP5i7BadlHa+DjSvEIaQNMIp2WMDWxyPARwXBCR/89GI+3tAdl iMnhElxD171WiCvfhTo4r0FmpkXS4FiksDj864v0SJ2IinE56971ultRAB48PY87a4jB walw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=NC41O/n13DCYNM/lLsGNXAacEcjdBJ1LsF2Nrsq3/8A=; b=WUao8c/Q6ob/PV3mxbfJ6U+jKqAR3/26/a5V/Np7nP0RwUdhqPTWgLaVysJO9u5U9F oAzHoNR7VJlwwSZQlHdngHI00D/dzKycf2DxgPSPDf03Ch4Vg5y/yl6/JFq5lUT97G1B XjIr319UJByb+ELLZYKW7pF1K91SZKSZeaE0EDEBqAQkr2lXtz2wlhZnBu6qlYYV2gTN MRSS5BoJnTVwTMN68osnwJPZvT1GFOq6pca0ARgyybLMKu/sKNIIEmp0l6NsUD0kQ7iS mu9/fnWO2w2HNz7LHncXpIrbdakeXMD3//MyK06WbR4KsUatwdZT11yhKk0EI5GAKV6G DrKw== X-Gm-Message-State: ABUngvdGdCDQUzCCPSWnQ9w52nF07DsyL0nHdNJqakwMMPHDLfUePosahOhzLnV9kZEqkj32aG9fDoPsFQV8Ow== X-Received: by 10.37.48.6 with SMTP id w6mr4388290ybw.83.1478779956384; Thu, 10 Nov 2016 04:12:36 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.13.235.81 with HTTP; Thu, 10 Nov 2016 04:12:35 -0800 (PST) In-Reply-To: References: <0c171a20-c72d-4157-1117-6628a52dd1f0@gmx.de> Date: Thu, 10 Nov 2016 05:12:35 -0700 X-Google-Sender-Auth: k-B3tHLTZLX6-AS4OSDqgldHZ4U Message-ID: To: Niklas Keller Cc: "Christoph M. Becker" , Joe Watkins , =?UTF-8?Q?Micha=C5=82_Brzuchalski?= , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC][VOTE] Object typehint From: levim@php.net (Levi Morrison) 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 thi= s >> > feature in particular. >> >> Can you please elaborate what you mean with variance? I see some >> 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 all 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 weeks on th= e >> >> 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 guarantee 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.