Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115693 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53354 invoked from network); 11 Aug 2021 11:38:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Aug 2021 11:38:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF6DA180505 for ; Wed, 11 Aug 2021 05:09:34 -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-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.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 ; Wed, 11 Aug 2021 05:09:34 -0700 (PDT) Received: by mail-ed1-f42.google.com with SMTP id bo19so3349115edb.9 for ; Wed, 11 Aug 2021 05:09:34 -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=B1Y1SIBM99Rj0KsNxFnFdwPau2X+/Jw7NbJC0/y411w=; b=fBwz1YIRpcrgb13syrlHlgmHbMHfgcuV/mHdvtVW5iLdWD8J6wju2JQlXhjQsX8eIw juVtUNxGLsN8o5lM9zfC8+r+lB9gHipD9bfiIrVkX9vUH6Q3L1DLqb4oimKBWd3QwBbV CIUBTi1ZmgpFyHCDgsBV3/ikISvlIPIGxH0OiS5BGDTQuzeArMkeJzEsFKCv5pMBdjZ1 zRB+0swd+Uidm67cdLzGwCwlTa5dL5qQ/6f1SCxZiPou2aZu83/b3SWiSehqOI42CuML Yt9Kk50173GxUKoTC8QRWCyvipGSEuDvB902ULHz5JYmebhrTHKXOU5CgdafGiM543mH ARPA== 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=B1Y1SIBM99Rj0KsNxFnFdwPau2X+/Jw7NbJC0/y411w=; b=udPaWDM4CrOc69EPvi5Aa5wXoUmR34OOc92W/1wXSC4qgVFP9S5WDCuRFs7HOlZr9I B5cNIfjs6dhRPfd0wdHOSlSc1L5b+7B5iX98z6aGahSPYqDX0665FU92H90bje82SBLX hkpXJS62hQpCyektediDvx0TRdJYmcJDhjMMN+S49oizkQTXoXs0kSLSUyBRVJW+Lsvb gXdFrbrIyjmCco7woI0yCS+/5sE9O/MlR7IZOI/fPMI4uuadtZG6zHPB/aIi7vOHtvPH +sryYHD6YbD4oaaaaCvw+Q7OU8WMnS043O1kfr/FfwvciW8g+eecOQHIJajjsY8BnofB qWbA== X-Gm-Message-State: AOAM531ZKitb4VbmkU9Wwyc9jbcBnIYgdvj9tdMpKSOfQYqrgnnYVjwh /Ki8bitKbZSZptL/uV9YX1SQ1t3VrlWYOu7/sYk= X-Google-Smtp-Source: ABdhPJwIFuxtjDmMtS6MvU2dWwPJjfxhDd26egVeJ9FRGnZAqs8Guwsxkv9Gs2Mb7hZcREnHfDKQzaWp45d+L4T3w9E= X-Received: by 2002:aa7:c805:: with SMTP id a5mr10836883edt.23.1628683772355; Wed, 11 Aug 2021 05:09:32 -0700 (PDT) MIME-Version: 1.0 References: <09e013c7-7104-82be-6711-41f74d9f1666@gmail.com> In-Reply-To: <09e013c7-7104-82be-6711-41f74d9f1666@gmail.com> Date: Wed, 11 Aug 2021 14:09:20 +0200 Message-ID: To: Rowan Tommins Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000b3e97305c9477d14" Subject: Re: [PHP-DEV] Re: [RFC] Nullable intersection types From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000b3e97305c9477d14 Content-Type: text/plain; charset="UTF-8" > On 10/08/2021 13:39, Nicolas Grekas wrote: > > I will wait if I don't have the choice, but as many others reported, the > > experience with 7.0 missing nullability was a pain. > > Apologies if you already did and I've forgotten, but could you please > expand on what "pain" you are referring to here? > I personally did not experience that pain because I just skipped 7.0, since it wouldn't allow expressing the nullable return types I had to express in the APIs I maintain. Firstly, I'm guessing we're talking about return types here, since > parameters have had types since 5.0, and nullable types since 5.1 with > the "TypeName $foo = null" syntax? > That's correct. And that made me realize I missed highlighting that the situation with intersection types is actually worse than the one we had in 7.0 vs 7.1. As of https://github.com/php/php-src/pull/7254, not only return types, but also *arguments* are affected by the non-nullable limitation. If the RFC doesn't pass, I would still be in favor of reverting that part of the PR. That would bring us a situation very similar to 7.0 vs 7.1, which was not ideal but still better. > Secondly, do you mean you postponed your adoption of the feature, or was > there some larger issue? > I postponed it (and others did, as reported by Benjamin and Tobias in a previous message.) Note that I'm not running this RFC for my own personal benefit. I'm running it because I care about making PHP (and each release of it) as good as possible. I will postpone adopting the feature if I don't have the choice. But until it's too late, I'm willing to engage in this topic because I think the current state is far from ideal for 8.1. The larger issue is that when used as a type on arguments, adding the nullability flag isn't possible without a BC breaking change. Regards, Nicolas --000000000000b3e97305c9477d14--