Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115591 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91920 invoked from network); 27 Jul 2021 13:05:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jul 2021 13:05:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 32D971804D0 for ; Tue, 27 Jul 2021 06:32:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 159.69.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from srv015.mail.ichtushosting.com (srv015.mail.ichtushosting.com [159.69.182.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 27 Jul 2021 06:32:07 -0700 (PDT) Authentication-Results: srv015.mail.ichtushosting.com; iprev=pass (srv021.web.ichtushosting.com) smtp.remote-ip=78.47.76.72; spf=pass smtp.mailfrom=stitcher.io; dmarc=pass header.from=stitcher.io Received: from srv021.web.ichtushosting.com ([78.47.76.72]) by srv015.mail.ichtushosting.com stage1 with esmtp (Exim MailCleaner) id 1m8NBk-0002bn-P5 from ; Tue, 27 Jul 2021 15:32:04 +0200 Received: from ptr-fq9l27xfjsrlyshu3yz.18120a2.ip6.access.telenet.be (ptr-fq9l27xfjsrlyshu3yz.18120a2.ip6.access.telenet.be [IPv6:2a02:1812:c3b:6800:ed1a:454f:509:709b]) (Authenticated sender: brendt@stitcher.io) by srv021.web.ichtushosting.com (Postfix) with ESMTPSA id 53F831F858; Tue, 27 Jul 2021 15:32:03 +0200 (CEST) X-MailCleaner-SPF: pass Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Tue, 27 Jul 2021 15:32:02 +0200 Cc: Nicolas Grekas Content-Transfer-Encoding: quoted-printable Message-ID: References: To: PHP Internals X-Mailer: Apple Mail (2.3654.60.0.2.21) X-MailCleaner-TrustedIPs: Ok Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: brendt@stitcher.io (Brent Roose) Hi all =46rom a userland developer point of view: - PHP 7.0 types were a pain because of non-nullable types, the feature = only became really useful as of PHP 7.1 - I share many people's opinion that this falls in the category of = oversight - I think (A&B)|null is the only sensible way to go Sidenote: weren't there any prior cases where an RFC was accepted only = to have found out an oversight which resulted in that RFC to be = postponed to the next release? Kind regards Brent > On 26 Jul 2021, at 16:14, Sara Golemon wrote: >=20 > On Fri, Jul 23, 2021 at 4:58 AM Nicolas Grekas = > wrote: >=20 >> https://wiki.php.net/rfc/nullable_intersection_types >>=20 >>=20 > I've commented on the PR and in R11 a bit already, but I'd like to = state my > position here for the record. I do see the value in having = nullability, > but I can't disagree enough with the `?X&Y` syntax no matter how > technically right the argument about operator precedence is. Even = ignoring > that literally nobody carries around a complete operator precedence = table > in their head, we simply can't predict how making this decision now = will > impact future plans for combined intersection/union types. The same > argument honestly goes for every other syntax proposed, including > `(X&Y)|null` which is also prone to making things worse. >=20 > Nullable intersection types *IS* an implementation of combined > intersection/union types, even if a narrow one. Those have not been = planned > out or approved, and they're too broad to sneak in post feature = freeze. > Period. Let's take the coming months to flesh out the edge cases on > combined types. Let's maybe even look into type aliasing, which may = have > the side effect of making combined types more readable (or maybe less, = who > knows!). >=20 > Most importantly, let's accept the fact that PHP's release cycle is = only 12 > months and we had pandemics that lasted longer than that. Next year = is > right around the corner. >=20 > TL;DR - I've decided my vote. >=20 > -Sara