Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115556 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78671 invoked from network); 23 Jul 2021 10:39:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jul 2021 10:39:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 494E91804AA for ; Fri, 23 Jul 2021 04:05:40 -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_H2,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-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 04:05:39 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id m9so1207514ljp.7 for ; Fri, 23 Jul 2021 04:05:39 -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=r0htTyghzlBZ44iKdbP8Iy/4kbPvv+Djs8zPEyWBJ40=; b=LEpi8M+gFEGhvbcQgS7jeb/LVHa5qISCkKUAZURxazZyQuyoYG3WN3CA1RiljN1nhN 7XlmXP1s/UJaRdzzA41NMPN4cYCPkoec1mXPutAh8yQetCGNGotU2gGRsyCiKkT9y9QA Wfbz9JrV2aQzNTF5SebSiVint2Y8fCKkAtqBOUyoz9drtQCOeABaZYNaDqxSU2S9O/DA MsgdP5/Lcjn+urE5L05cggOF3wOnsAkAyJc+zd5XIQGfUbWluJwkOF1o8jdhlZbQFyxC MmqMIZb8vmW+6vgueTXEmFJRbDWZUfmB5tMYOCZdUboT6xbgNSqI7HLylEz8BXUI8zw2 o2QQ== 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=r0htTyghzlBZ44iKdbP8Iy/4kbPvv+Djs8zPEyWBJ40=; b=A0fgQhBdAP/EqksxCIL/IvLeWC56TYcY1pfjUIWPGrd5OMiCrDDPn4hgFQvgNFcIuc +T1vDwEZMPqQwTZZMMAoV0ArMV+vwU94PgDR9KIvWguPGR1GN2wldsEhBPIpGdaZdlr4 txRMs8xu5IJw8z0FrtKNGybBAD3zz3/1kneNDYyJYcxGr06nkPNAD0UprKGP6hjx4RLL DdQR9RenLfwlfoMot95qZ+kFU3CLUAGTVeylbAQFtThsv3lyOYUOOT4aW59tX7DHn+5f DloZk0hIPqwIj7yiM3l/V29RDdTy8d2fpDoVSgK/1OYr1ofbXvcPpzdRdrq6lBEBuCRM e4pg== X-Gm-Message-State: AOAM5310tc9blXJ1LFlnY9Bdi2/Ee/zBYPIU6W50cT84IZMAkjtxMbL6 IZ90hfV9AXjpH82jS3deTOEJcgV/Tb+uLegnqA== X-Google-Smtp-Source: ABdhPJwwYXkNgoqpiAEWWw79pJ4ytG6Bxgif0EnjTF8/OyUDAQfToiQqiirVRW1TWog0EO1CZHIogM/2llQQy4jhUYA= X-Received: by 2002:a2e:b530:: with SMTP id z16mr747591ljm.22.1627038337293; Fri, 23 Jul 2021 04:05:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 23 Jul 2021 13:05:26 +0200 Message-ID: To: Nicolas Grekas Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000002162df05c7c86295" Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: guilliam.xavier@gmail.com (Guilliam Xavier) --0000000000002162df05c7c86295 Content-Type: text/plain; charset="UTF-8" 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)"? Regards, -- Guilliam Xavier --0000000000002162df05c7c86295--