Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115586 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19898 invoked from network); 26 Jul 2021 13:48:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Jul 2021 13:48:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7931618053E for ; Mon, 26 Jul 2021 07:14:50 -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=3.2 required=5.0 tests=BAYES_40, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 26 Jul 2021 07:14:49 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id h9so11462351ljq.8 for ; Mon, 26 Jul 2021 07:14:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9gFPJQryFRRb07c5d7LrlUcym1ZD0Z0C1vOHZxQoCm8=; b=UMz7/BhGQMzftj45E6ipm1l6EbFYaJvv6+EHpWbt79igzmETdQf8FvLRHPk/sIxAj9 r96fLCitRBEqatsJDKUUAFipyDR76IZzjKdHB+1BoFg1tZ/4RP8uFzIh4AOj0Wi61WZ4 yEu2RsKdAn+MPoTG3uvmM7EjrIRmL2j/hI12jkmynitzD9t0w7JZKWCbc8JHDRFruww0 eGqR67/n15zVGKCsKa8r+dH4hqfZBpUPuIGJ2XQzjf1Fq+TDCvGjT8MgQU0A7oFzs4z5 pf54Zxig51PSXzSAfJq+cWGQfF5l2g7zsNM+hlC4bEKqkDMXgUHCt2aWx17lmgpr+EKe RBMA== X-Gm-Message-State: AOAM5339lJvii72Smxrbz+60RqCbckf01HB7LYsVEsTE0w1SsecPYs5e YaN2K+3mlXJPqqmdGCpB0NyMnih8iPqlKNvO15aiSA== X-Google-Smtp-Source: ABdhPJwufS8kOm2SiPgveRrAd+CTiSFRELMl/3yntCqasxD5h64KRV8/FjQNQgOMzznU13q0dOzioC8Y+3LEKSWotoc= X-Received: by 2002:a2e:9b84:: with SMTP id z4mr12557386lji.360.1627308888431; Mon, 26 Jul 2021 07:14:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 26 Jul 2021 09:14:37 -0500 Message-ID: To: Nicolas Grekas Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000003c4a8b05c807601b" Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: pollita@php.net (Sara Golemon) --0000000000003c4a8b05c807601b Content-Type: text/plain; charset="UTF-8" On Fri, Jul 23, 2021 at 4:58 AM Nicolas Grekas wrote: > https://wiki.php.net/rfc/nullable_intersection_types > > 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. 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!). 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. TL;DR - I've decided my vote. -Sara --0000000000003c4a8b05c807601b--