Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115557 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82423 invoked from network); 23 Jul 2021 11:46:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jul 2021 11:46:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 909BC1804B0 for ; Fri, 23 Jul 2021 05:12:00 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS 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-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 ; Fri, 23 Jul 2021 05:11:59 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id he41so3341116ejc.6 for ; Fri, 23 Jul 2021 05:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y5fY8rgmbaBx3otwC96qNDxJlw0N2oN1RAylrB0iFzk=; b=OTKAzk6O5fHW18oujhdjMhaCbvyCurbuIa2GNJzNJCoO1hs6Vse8gzwBjGtl7q0QKW YnZx8t3bEzREKFViTrRmVR3UGBtz3CAa63pfYZzbv7C/FrOKtkvXkDcnlktU8XqFDX7r Bay1nxRK+GK7gQuedugFMAitRrrTcTwQncdbkWpGco/i01P1geykYsCmLDv0O13Ufx5v XBjc7m8NDP9RQ2vZQPm1ZEjd7/yrRUXAmUxQIUjAXLwlR0Z3g2J2/BKkDysT6kISMRDz xRWP0XFPY8CXBrgFKoz+yWnKig5PWpbiRIfRdXPFZnWDzQ+HsLucn+7HF87thDVsspm+ U3hA== 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=Y5fY8rgmbaBx3otwC96qNDxJlw0N2oN1RAylrB0iFzk=; b=aYSWwrZ4fHacpEcW8kuioB9FiR4XlYKgi+62ySH+dF0La0qx1zyltsFexgRdjpQBGj SzDlG+2Mj6SRV6RR/x0myIBRJbhmQszROlLcqhCNZGygzbUw5PBPlQCDRhAYrEEgV1GQ oc7o30FxgRAGM+ractzjMKPADC/TyxSxOWtEpgs8+8it+6W/U+QbzDFVJJ06zH1Cgetu GP5DlANmwYPN5lk7iyC5RUL0NjL3TpC3PLDSF7w+OIe5VaLg0/AMyVlNPiM/kuw3zUa1 dgzVR1DPsa/WvsFk8ao66Khcz4qe9fNvI405J6cIYt/gqQuGaPWEmNPnjyjp/gcahx3W 6Fqg== X-Gm-Message-State: AOAM5337F5x52nfSHmeAMfa/jQQkzo4LI8eo/4bEG+Z+ks76908hdf7N 917qCO0LtkOsAvBtIf5+xSsDdPPmI5mFVQ37zYk= X-Google-Smtp-Source: ABdhPJxVy3IUL0k6OgaZfDomn5SH6mLjYYJBCVUI+ox2XYyZbuMaVzBEj9T9A/x5IB94JROR5it2Rz08I2eliEbC/wY= X-Received: by 2002:a17:906:f11:: with SMTP id z17mr4408677eji.385.1627042315498; Fri, 23 Jul 2021 05:11:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 23 Jul 2021 14:11:43 +0200 Message-ID: To: Guilliam Xavier Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000003ff97505c7c94fd3" Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: nicolas.grekas@gmail.com (Nicolas Grekas) --0000000000003ff97505c7c94fd3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le ven. 23 juil. 2021 =C3=A0 13:05, Guilliam Xavier a =C3=A9crit : > > On Fri, Jul 23, 2021 at 11:58 AM Nicolas Grekas > wrote: > >> Hi everyone, >> >> as proposed by Nikita and Joe, I'm submitting this late RFC for your >> consideration for inclusion in PHP 8.1. Intersection types as currently >> accepted are not nullable. This RFC proposes to make them so. >> >> I wrote everything down about the reasons why here: >> https://wiki.php.net/rfc/nullable_intersection_types >> >> Please have a look and let me know what you think. >> >> Have a nice read, >> >> Nicolas >> > > Hi Nicolas, thank you for putting this up. Just two editorial notes: > > - "This is because any intersection that contains the null type is > identical to the null type itself.": I don't think that `X&null` is the > same as `null` but rather like `never` (i.e. the "bottom/empty" type, or > simply "impossible/nonsensical/bogus")? > > - "Should brackets around the intersection be: not needed / mandatory / > allow both styles": maybe clearer would be e.g. "forbidden / mandatory / > optional (allow both styles)"? > Thanks, I edited both to the following: - any intersections that contain the ''null'' type are identical to the ''never'' type. - Intersections should be: without brackets around / with brackets around / allow both styles --0000000000003ff97505c7c94fd3--