Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99080 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48598 invoked from network); 17 May 2017 16:26:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2017 16:26:23 -0000 Authentication-Results: pb1.pair.com header.from=michal@brzuchalski.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=michal@brzuchalski.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain brzuchalski.com designates 188.165.245.118 as permitted sender) X-PHP-List-Original-Sender: michal@brzuchalski.com X-Host-Fingerprint: 188.165.245.118 ns220893.ip-188-165-245.eu Received: from [188.165.245.118] ([188.165.245.118:51007] helo=poczta.brzuchalski.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/A6-21791-8A97C195 for ; Wed, 17 May 2017 12:26:17 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id EC7C52984237 for ; Wed, 17 May 2017 18:26:13 +0200 (CEST) Received: from poczta.brzuchalski.com ([127.0.0.1]) by localhost (poczta.brzuchalski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aHFtj9s_9uVY for ; Wed, 17 May 2017 18:26:03 +0200 (CEST) Received: from mail-wm0-f46.google.com (unknown [74.125.82.46]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id CFCA52984235 for ; Wed, 17 May 2017 18:26:03 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id d127so22201525wmf.0 for ; Wed, 17 May 2017 09:26:03 -0700 (PDT) X-Gm-Message-State: AODbwcDPXZwN5agiZU9mf6cD4FW8929znbN/R3HEkTC7a/pN9YagcsKP lWvMcM0wHTOwEUfRnlezeo7N+KOSug== X-Received: by 10.28.39.1 with SMTP id n1mr10731042wmn.109.1495038363574; Wed, 17 May 2017 09:26:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.136.253 with HTTP; Wed, 17 May 2017 09:26:03 -0700 (PDT) In-Reply-To: References: Date: Wed, 17 May 2017 18:26:03 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Levi Morrison Cc: PHP Internals List Content-Type: multipart/alternative; boundary="94eb2c05e9589630d3054fbabe54" Subject: Re: [PHP-DEV] [RFC] [VOTE] Object typehint RFC From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --94eb2c05e9589630d3054fbabe54 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank your Levi for your explanation. 2017-05-17 16:47 GMT+02:00 Levi Morrison : > > > On Wed, May 17, 2017 at 4:34 AM, Micha=C5=82 Brzuchalski < > michal@brzuchalski.com> wrote: > >> Hi everyone, >> >> I would like to put Object Type RFC up to a vote for inclusion in PHP 7.= 2. >> >> Previously there were some concerns about adding named types in the >> future, >> but we came to the conclusion that each of them can be solved if there a= re >> proposals in the future. >> >> Voting starts today, 2017-05-17, and will close after two weeks on the >> Wednesday 2017-05-31 at midnight. >> >> The RFC and voting widget can be found here: https://wiki.php.net/ >> rfc/object-typehint >> >> The vote is a straight Yes/No vote for accepting the RFC and merging the >> patch which require 2/3 majority. >> The additional vote is also a straight Yes/No vote for accepting varianc= e >> behaviour on the object type which also require 2/3 majority. >> >> Thanks! >> -- >> regards / pozdrawiam, >> -- >> Micha=C5=82 Brzuchalski >> about.me/brzuchal >> brzuchalski.com >> > > An emphatic "no" on variance for me. This is for two over-arching reasons= : > > 1. Object variance should be implemented when we have generalized > variance for all types. By special casing it now we open ourselves to the > possibility that its implementation or semantics will differ from the > generalized solution. > > 2. The way it is implemented prevents us from adding new types which ar= e > not objects. The reason is that the way this is implemented it just assum= es > that an unknown type is an object type. If we add a feature such as an > enumerations (enums) this assumption probably breaks and cannot be fixed > while maintaining BC as it would almost certainly need to trigger an > autoload. > > We were thinking about enumerations and generally IMHO, they can be implemented as objects though. Especially when taking Java pattern http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html when dealing with enumeration means dealing with a special purpose and special kind of objects, which are IMO more powerful with methods which can implement some behaviour. > Given these two points I think it's unwise to implement variance as > outlined. I highly encourage other voters to vote against that portion of > the RFC. > > ----- > > Lastly, I want to thank Dan and Michal for working on this RFC as an > object type even without variance would have been useful for me in the pa= st. > --=20 regards / pozdrawiam, -- Micha=C5=82 Brzuchalski about.me/brzuchal brzuchalski.com --94eb2c05e9589630d3054fbabe54--