Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96815 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48118 invoked from network); 10 Nov 2016 12:21:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2016 12:21:01 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.179 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.179 mail-yb0-f179.google.com Received: from [209.85.213.179] ([209.85.213.179:36830] helo=mail-yb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/52-15787-B2664285 for ; Thu, 10 Nov 2016 07:21:00 -0500 Received: by mail-yb0-f179.google.com with SMTP id v78so87932166ybe.3 for ; Thu, 10 Nov 2016 04:20:59 -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=8FXv2w35m7pfZxQV0d+PfyQAcTTuqOeX9CH7LYfSgRc=; b=me5u36NNhP2TSutqbAnv9L8uFqVvTX4/atoqw7ZwOxBcJKU5dB5tokLaOLJYKmaD97 TC5RY0VFZxuFtsJmpXwGODohiNy6PeIdK8eiMwC6W8Cd7LCci0MWFlnJmTh8cMBXgrvI IW4UWLhZdEq6iH48vo8XbGsA64mp4LHePM9/3pA+kRHSiTucXkv3GeuMEgGQHdGmYOJy pUz2lNN3rPTS4QDFdIc/bzN5e6QdBeVlNlUJ/567eIfezefepkbTyoRNpp5puTz+18jU ltlDA9Cn0VkqyoWzOl4mO//6iv+/QXujKpSGTBBzJC6jfwvRmKzsCj+v2aQzPkcUhVJi ZSBQ== 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=8FXv2w35m7pfZxQV0d+PfyQAcTTuqOeX9CH7LYfSgRc=; b=NPVBxjLyYwj3pNvcDPAro0ocvCvPmQeBY0ZiI+IuPq5mWH6LTSX8NB1ibQK/Tfmalw pk3ft/Tsb/f7pFQ1I1kQtcz7FXDx+UC72mt75RPPkxUPbWaktpo5IPcH5KYPWWy0YQmG AxTKle8oYdwiwoG18gWsgbQjA0loPXZU7dWjVD8ZWFTi5eiLRaIEaOf5qMi33ue3zyBs G6meI9qrhUAZqF6XbZULQiR++0txPuDLV9UiFfjfLF2ADrYn0XY4RJawxiDZU+38pzAP NRBdwj3lcZIy1ePlUYQ8Sz7ju7HyB5vZQ51oqWaDPJLeOp6Gaij+0g+krJInYprZHBF7 tUEw== X-Gm-Message-State: ABUngveSXsLuoSgiedR+GXEuCaEVioxxEmHMJECZWBrsSwKhOsH1YjpIjpU5Fhd+7SyJE+tY2FjuE0wyrb09Eg== X-Received: by 10.37.48.6 with SMTP id w6mr4424539ybw.83.1478780456974; Thu, 10 Nov 2016 04:20:56 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.13.235.81 with HTTP; Thu, 10 Nov 2016 04:20:56 -0800 (PST) In-Reply-To: References: <0c171a20-c72d-4157-1117-6628a52dd1f0@gmx.de> Date: Thu, 10 Nov 2016 05:20:56 -0700 X-Google-Sender-Auth: vPETtiC_ZaU-KvUkskHVGDVKsDU Message-ID: To: Joe Watkins Cc: Niklas Keller , "Christoph M. Becker" , =?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 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, varian= ce >> >> > 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 some >> >> practical use cases for covariance of a method with return type objec= t, >> >> but I don't see how contravariance could be achieved for parameters o= f >> >> 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 oth= er >> > 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 >> >> >> 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 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. > > I strongly disagree here; once we add `object` return type covariance it cannot easily be removed.