Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92789 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81754 invoked from network); 26 Apr 2016 14:53:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2016 14:53:55 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 65.55.169.146 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 65.55.169.146 mail-bl2on0146.outbound.protection.outlook.com Received: from [65.55.169.146] ([65.55.169.146:56439] helo=na01-bl2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/F2-02401-EF08F175 for ; Tue, 26 Apr 2016 10:53:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=D1EinDc6jfMFcpEe/t+uoQdW4jvvkS9YXLBSsjjvDvI=; b=BC0NuIyUibRGg7oam5zCQxQ4QVyYkwybJBCxBFkIHNFJB9SImIyRGSednvgQssprKZBFote65c4uAbHRrzIFLjVoJlF+T3OFepnXrV61Pgv4sB8Cd2aCZDXcwv4D7Uqp1MCrBTB8AsbG8OXBN09J4mmDFlV1twXLPapxSdmuXck= Received: from CY1PR0201MB1786.namprd02.prod.outlook.com (10.163.55.19) by CY1PR0201MB1786.namprd02.prod.outlook.com (10.163.55.19) with Microsoft SMTP Server (TLS) id 15.1.477.8; Tue, 26 Apr 2016 14:53:46 +0000 Received: from CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) by CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) with mapi id 15.01.0477.012; Tue, 26 Apr 2016 14:53:46 +0000 To: Levi Morrison CC: Bob Weinand , internals , Joe Watkins Thread-Topic: [PHP-DEV] [RFC] Patch for Union and Intersection Types Thread-Index: AQHRn0t8HUIa69RiokmK3RsmiQ6ep5+cOtH7gAAT04CAADV6gP//0m8AgAAAX/c= Date: Tue, 26 Apr 2016 14:53:46 +0000 Message-ID: References: <571F7B91.2030102@zend.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: hotmail.com; dkim=none (message not signed) header.d=none;hotmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [92.62.57.172] x-ms-office365-filtering-correlation-id: 2268e070-722d-40af-1521-08d36de29199 x-microsoft-exchange-diagnostics: 1;CY1PR0201MB1786;5:pdNrK4rL6K34J2YYtZ2fNR7NWVeoC1eBFvR9HsBqha3b2T5Fbf9lgTblV+d2jvn19h9JBSXUF1WQhotH0r8Mba69sQfdo86fynnAZspKoxoHxQVqspeWIi2m9i7oBDX6G9Fdqiu7uedZks4sy0xnxw==;24:iIEIIZ+wIVFTpretB/MEw4ohVezx7rVNd7HxXBNwURtNgNKmfddQE5xDHiddSzRwir0noNVnej3cJ31QG3s211/Pr3EHC7Eihbt9aVMuCV0=;7:xMWIYOSJzSPUKpLgZEcrbhBrGAtvb/xhnL2jpirEt33ccIPrt0XatpCgDo7IV/HVp7zAKGmQt9rTnWcLtgtrJspNQiQ7B2v01Siw854eOvTpmkhT1al0uHozLJ5bCOoIO10xBdwvigD3IXiY0lvJUj2nbz7H/KBvacTBNSwyeFPThRf5iRTV2wEUdHXaGNm4 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1786; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:CY1PR0201MB1786;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1786; x-forefront-prvs: 0924C6A0D5 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(106116001)(122556002)(4326007)(93886004)(81166005)(3660700001)(110136002)(5003600100002)(586003)(6116002)(3846002)(9686002)(99286002)(1220700001)(1096002)(102836003)(66066001)(5002640100001)(2906002)(19580405001)(19580395003)(77096005)(86362001)(189998001)(76576001)(74316001)(15975445007)(5008740100001)(92566002)(10400500002)(5004730100002)(11100500001)(54356999)(76176999)(3900700001)(50986999)(33656002)(3280700002)(2900100001)(2950100001)(87936001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0201MB1786;H:CY1PR0201MB1786.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2016 14:53:46.0418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1786 Subject: Re: [PHP-DEV] [RFC] Patch for Union and Intersection Types From: dmitry@zend.com (Dmitry Stogov) "Foo | null" doesn't make sense without "Union Types". Voting for one RFC first makes a preference and unfair. Voting for two different RFCs with 2/3 majority is not good as well. But this is the best option from my point, in case both pass we may make ad= ditional voting with simple majority "Union" or "Nullable" or "Union+Nullab= le". Thanks. Dmitry. ________________________________________ From: Levi Morrison Sent: Tuesday, April 26, 2016 17:47 To: Dmitry Stogov Cc: Bob Weinand; internals; Joe Watkins Subject: Re: [PHP-DEV] [RFC] Patch for Union and Intersection Types 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=85 No= w, >> 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?