Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115555 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76743 invoked from network); 23 Jul 2021 10:28:51 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 23 Jul 2021 10:28:51 -0000 To: internals@lists.php.net References: Date: Fri, 23 Jul 2021 11:54:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 87.81.129.66 Subject: Re: [RFC] Nullable intersection types From: marandall@php.net (Mark Randall) Message-ID: On 23/07/2021 10:58, Nicolas Grekas wrote: > Hi everyone, > I wrote everything down about the reasons why here: > https://wiki.php.net/rfc/nullable_intersection_types IMO we should require brackets and forbid not using them when combining unions and intersections. These types are already going to be confusing enough and we can likely save a fair amount of confusion and pain down the line by requiring the explicit brackets. Without wanting to bikeshed, let's just make sure we're set on () because whatever we choose here will be the defacto mechanism for declaring sub-types in PHP for the rest of eternity so it would need to be maximally compatible with everything we might want to do with them.