Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92788 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80191 invoked from network); 26 Apr 2016 14:47:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2016 14:47:39 -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.192.193 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.192.193 mail-pf0-f193.google.com Received: from [209.85.192.193] ([209.85.192.193:33062] helo=mail-pf0-f193.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/92-02401-B8F7F175 for ; Tue, 26 Apr 2016 10:47:39 -0400 Received: by mail-pf0-f193.google.com with SMTP id e190so1998096pfe.0 for ; Tue, 26 Apr 2016 07:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=qcO2S0eQVYj/oaJRyDeEmHECv1TNpACzbGtbdiTS+kM=; b=BZx+mpvkFLB6FzREXBcIgGszf5oSmlUKKg4X6Rpnx2eiVYyK9CyammopuvR91OfCrb sxWWauHvig5zrkG5fvgpwgwe/3IXF0Ew3S/eVlBZ6d4hjwF79oercl7DzT3SLnLRGGsf NWzh8XtKX7Ba0CWm0wQoL90aV18ZEx/5t7VxYnBcJlUW35bScxYaKhbi9MIwoAmAdczb 4/Ibb5sRwPbU+1Vqd/SqP9XH5KMY/m80cw8LfxqCnfMQ3L5qH3uBUQi5SapkzgVgbWl+ 8zWHvEO2VYvHi/gh6cr4z4oVXjoIWxd9C02XwDogDZme8F3EGo3sWXRoxs8qSAP90Yo9 6byA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=qcO2S0eQVYj/oaJRyDeEmHECv1TNpACzbGtbdiTS+kM=; b=DbpYEpBrOoOcTv1sYoq3a6mX6Oz3N3Jhied4uKnQ2ipLCRtneDJ9bTqEIh0KOtewCq yg0hRq5s3L/G71Qo0e8XCMxDsU16T7gPSGgOr5+YDBRJX/VE5lf2Yn7LGZ/CrjX2BdRi 2+98ffNx4hMFCsjHVZgYD89Fd7J5X/+JT6afnUqDhVLJuirzeUZ6EH1U8f4MnMpb7PBt DTzR0111hUvKNPJWYIdKYdTcBgrLuUPTdzz+XsGWoqslsQQhqRNA7z1CK4/jMOOltLvy t3mSIPXBBY/xi5tYBJuCTNn56NkzXGDGW0O+/ZYNEvFMPpZS5DNHqytHtrzL5t1BuTnP rXBw== X-Gm-Message-State: AOPr4FWKI841dafuPIVgxAa6sXDrRW8ofgwdpRpSdSSSFKWu2nN3uIOzRuKY0QKsV+gx6v1/Xx9Ts5dQkgOhpw== MIME-Version: 1.0 X-Received: by 10.98.3.133 with SMTP id 127mr4157436pfd.93.1461682056585; Tue, 26 Apr 2016 07:47:36 -0700 (PDT) Received: by 10.66.132.79 with HTTP; Tue, 26 Apr 2016 07:47:36 -0700 (PDT) In-Reply-To: <571F7B91.2030102@zend.com> References: <571F7B91.2030102@zend.com> Date: Tue, 26 Apr 2016 08:47:36 -0600 Message-ID: To: Dmitry Stogov Cc: Bob Weinand , internals , Joe Watkins Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Patch for Union and Intersection Types From: morrison.levi@gmail.com (Levi Morrison) On Tue, Apr 26, 2016 at 8:30 AM, Dmitry Stogov wrote: > > > On 04/26/2016 05:19 PM, Bob Weinand wrote: >>> >>> Am 26.04.2016 um 15:33 schrieb Dmitry Stogov : >>> >>> hi Levi, >>> >>> It looks like your "work" on "Nullable Types" RFC was intended to win >>> time for this patch and block "Nullable Types" again. >>> Actually, you have been blocking it for more than a year :( >>> >>> I'm going to push my own RFC for voting together with "Union Types". >>> >>> https://wiki.php.net/rfc/nullable_return_types >>> >>> At least, it has up to date implementation. >>> >>> We discussed this internally 2-3 weeks ago, and my politeness (or/and >>> stupidity) allowed you to pass your version for common discussion. >>> Now I can see your real reason :( >>> >>> Both "Union Types" and "Nullable Types" may make sense, and both should >>> be voted at the same time. >>> Tomorrow is time to start voting. Right? >>> >>> Thanks. Dmitry. >>> >>> >>> ________________________________________ >>> From: Levi Morrison >>> Sent: Tuesday, April 26, 2016 02:37 >>> To: internals >>> Subject: [PHP-DEV] [RFC] Patch for Union and Intersection Types >>> >>> Internals, >>> >>> Joe Watkins and Bob Weinand have worked out a [proof-of-concept patch >>> for union types][1]. Please go download it and experiment with it. >>> >>> A few things to note: >>> >>> * This patch includes intersection types. However, a type expression >>> must be either a union type or an intersection type; it doesn't >>> support both such as `Array | (Countable & Traversable)`. >>> * This patch adds `null`, `true` and `false` for type declarations. >>> * This patch includes conversion rules for weak types. >>> * It does not have short-hand for unions with null (`?Foo` being `Foo= | >>> Null`) >>> >>> These features (or omitted ones) are not necessarily what will be >>> voted on. Rather this patch allows us to experiment with these >>> features in code. This experience should be helpful for us to solidify >>> how we actually feel about these features. >>> >>> I especially would like people to try out the conversion rules for >>> scalar types as it has been a point of discussion. >>> >>> [1]: https://github.com/php/php-src/pull/1887 >> >> Hey Dmitry, >> >> Please, do not accuse us of blocking the nullables. This wasn't >> intentional and rather a coincidence that we provided a patch right now. >> First we wanted to concentrate our forces on getting a great 7.0 out >> before starting this RFC (as it didn't make it in time for going into 7.= 0 >> too as we waited for result on scalar types in general first). >> Then, as you're aware Levi had absolutely no time for a few months=E2=80= =A6 Now, >> he has time to manage things and we could move ahead quickly and write t= he >> patch up. > > I know, we all like to make our best for PHP. > Sorry, if I was too emotional. >> >> I'd like to hold first a formal (and binding) vote on whether "null |" o= r >> "?" should be used (in case both RFCs pass). Rushing things through righ= t >> now might just us ending up with semantics the vast majority dislikes. > > I didn't exactly get, what do you propose. One RFC with voting for > "Nullable" or "Union"? > > Thanks. Dmitry. > >> >> Thanks, >> Bob > > > > > > I believe the intention here is to decide whether we do the short-hand syntax for nullable types or only the long-form. I can understand the rationale of not having both or at least dis-allowing the syntax to mix them. For example, I don't think anyone really likes allowing this: `?Array | Travsersable` as . However, if the union types RFC does not pass then it seems odd (to me at least) to use the expression `Foo | Null` instead of `?Foo`, but I know Bob would like the long-form in all cases, hence why he would like a vote. Joe seems to just want nullables to have an outcome so it is no longer blocking typed properties. Is that a correct summary, Bob and Joe?