Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115694 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59426 invoked from network); 11 Aug 2021 13:00:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Aug 2021 13:00:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8E1DC180511 for ; Wed, 11 Aug 2021 06:31:19 -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.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, 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-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 06:31:18 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id h24-20020a1ccc180000b029022e0571d1a0so1986210wmb.5 for ; Wed, 11 Aug 2021 06:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=vIx3KDtVZk6t1PTt7iir8rLdiwEst2QkiNz4W2KJ0Hk=; b=jz8U1H20bu4zg3mYch417spoyvPXl5c1r/dcvJr7EWUAwZ1rH9CKGFggX25+73hv1T 9SAcZW9Cn6ZgNTPluMRYCCfdo3FxhRmliy0hIOO0eDhqLXpddtkzUJM4gcROYO8DSObA e4XTEEVBbNAOD5CZfp2UQcQu90ubNKLpwzYRR0LTqUWZYm7gbtE6buFSFGwRh1iUrdLA Yha/rmz7/q0YUAEJkp2pbs/z9LffW9BEWdA6svTdN4qFfgxYjBohr/23oAyUOu3miecj Wj0VCT0wu+xEKWH49Ps5b6fIowIJWrrEVhBzpopfbaiN2EPMUiIUqkXfiTBn7hlA1Hth 4DXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=vIx3KDtVZk6t1PTt7iir8rLdiwEst2QkiNz4W2KJ0Hk=; b=aYTQ7VU6Q8lCb0oQZ1wkBRRLjv+YaXbu9aqX10N3+R88cMVQ5QcfpP4krJwIkvFIZn QG4mFXwy0+dLhxpIKSybrwDEYgXtK8EJATSOq9pxZzoJB8oJJXkSlxq5/1XXtxiN43u8 QnzYz2G7YZTOEVQWUTl12h7bMc3lk8jGDQerswrtFvh331s/7mP0AJAuf6xGGku5BGxv DWSPvr6fzCoP3ZlyXi7Ar4u3VukinyVWeiGNjRVffgh55lIVrCNZPF1P5E4p7n66Radg KbzwAz2j7hrxF1K77sXQQTO48bVecx8IKvzuFP4eDprxMNCbEfe4ayWhrDJn1xW7TmTt eCrw== X-Gm-Message-State: AOAM531MxHhuXKKZROWDGoi1QArmQ3L+AQEBE1m/VECSeLwVAT3ZeYHS 8b/H7WxxaNYfuHRyJpi/0ZRvHYR7uZc= X-Google-Smtp-Source: ABdhPJz/1qDwvvciQVNIHgmZ6iB4peAv6+AiF61sasCJOq1QTEDEHwy31hDYgMVvE01B5TXmgCgNLg== X-Received: by 2002:a1c:32c1:: with SMTP id y184mr9413758wmy.70.1628688673085; Wed, 11 Aug 2021 06:31:13 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id s14sm23980436wmc.25.2021.08.11.06.31.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Aug 2021 06:31:12 -0700 (PDT) To: PHP Internals List References: <09e013c7-7104-82be-6711-41f74d9f1666@gmail.com> Message-ID: <7ea8efdf-38b0-47d3-59b6-f6cb6665b284@gmail.com> Date: Wed, 11 Aug 2021 14:31:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Re: [RFC] Nullable intersection types From: rowan.collins@gmail.com (Rowan Tommins) On 11/08/2021 13:09, Nicolas Grekas wrote: > > 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. Sorry, I'm still confused what the "pain" is *other than* feeling obliged to wait until 7.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. I can't imagine many people will force a parameter to be non-nullable just to use the shiny new syntax, then re-allow nulls in a subsequent version. More likely, they will leave that parameter un-checked until the full type can be specified. There is also a lot of code out there which is either: * in stand-alone applications, so backwards compatibility has no meaning * in private libraries with a handful of uses, so bringing uses in line is trivial * in public libraries, but marked "private" or "final", or documented as "internal use only", and therefore not subject to compatibility guarantees > 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. There are always more features we could add, and there will always be a judgement call of what versions of PHP a code base should support. If it was generally agreed that there was only one right way to implement nullable intersections, and it was a trivial change, then I'd support it as a "quick win"; but that doesn't seem to be the case. Regards, -- Rowan Tommins [IMSoP]