Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115570 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42862 invoked from network); 24 Jul 2021 03:27:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jul 2021 03:27:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C0AC71804D0 for ; Fri, 23 Jul 2021 20:53:39 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 20:53:39 -0700 (PDT) Received: by mail-qt1-f181.google.com with SMTP id g11so3012689qts.11 for ; Fri, 23 Jul 2021 20:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=KeJiFU3HmEt4W9R8crpAzLM3U4PEc4r1t2Dk+AL4FbA=; b=UdGZCEiK5L7GzxQkFxDcxOWUagkDduMyaUbLiP7d9FSuAGiJ4AFniGL8WHlpv9PHzn y11P8WF3T8+TsHik2wz46PCbDcthX8bIQDXjcdQQ7bTRJkL/RDZH2Jau3ases39zTPTQ /0+4s7MwRiU1R2FGn4sX4CJJ7BW3+OIWqtWxhxb1WQmHyj34PO1HeYQo4XIOYNXYHm5P LNqm8YXrVB8NkfQp4rmPVkqAQPl5UsmbIlyzmZJv8PULv5s7+ksWtTtNQF0Ra9OX4Iwm Lsa1g/IjoSEWivt/DCZMew5AnoBIYFZZQnWMVkLOXk+aIlFI3I3FfzuTnYR0xAh8FKPE 9VyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=KeJiFU3HmEt4W9R8crpAzLM3U4PEc4r1t2Dk+AL4FbA=; b=r5gTBlp9Efy+EiKJvE2CVZe3hxiE0Sqda3aDN7FCGdvHNP+aaCD0skzXCzY5t1qPRI i6Lhsu32NvzbtPmxYIo4OUwycVmv/F5ttEzj+/x8LmO9dibt1QU70j2BRU9mXACCYZk4 4Q2sivVWgBSxoXlLWJJl2T6Mgo3ow4a/sfECZ5MX+BTCb1l6YSId4qWB+9UJnD+alcxh SNU0qNXztj1gHkZmrEZ8n70nDwnpnRAZuQcLmEdyQIF9+Yg0VCGhGHmWA8DQcMX2nOIn GCaQTdHKW//nRktVAvhRhtfE5RcS5szcy1StsFLYZgglMxNvOslxRvSbuhE+Sd5BKKQv K/MA== X-Gm-Message-State: AOAM532DGB7ZGQ+exaa2uA8eZS7EuO+IkgtIZvg8pPx3LittksrosXoi lbFJ72Rr7FDPhfl5cgSIn4PwYQ== X-Google-Smtp-Source: ABdhPJxNXsKrK4Tu35FghBSBXQtUM/48Gw75oS1lGnlWutiPkfL/AXGUc8zj6PvwcNLHWlJDg/U0Nw== X-Received: by 2002:ac8:1347:: with SMTP id f7mr6507896qtj.70.1627098816937; Fri, 23 Jul 2021 20:53:36 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id d129sm15416281qkf.136.2021.07.23.20.53.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jul 2021 20:53:36 -0700 (PDT) Message-ID: <353F9140-7E59-4CD4-95D3-9BA8F9CA6C29@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_942F17DA-DD4B-4B85-8053-A97A8A451569" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Fri, 23 Jul 2021 23:53:35 -0400 In-Reply-To: Cc: PHP Internals List To: Nicolas Grekas References: X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_942F17DA-DD4B-4B85-8053-A97A8A451569 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 23, 2021, at 5:58 AM, Nicolas Grekas = wrote: >=20 > Hi everyone, >=20 > 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. >=20 > I wrote everything down about the reasons why here: > https://wiki.php.net/rfc/nullable_intersection_types >=20 > Please have a look and let me know what you think. >=20 > Have a nice read, >=20 > Nicolas It seems this RFC is actually trying to accomplish two(2) things: 1. Add typehints for nullable intersection types to PHP. 2. Get PHP to support a preferred syntax for type-hinting nullable = intersection types. Further: A. There seems to be consensus on the value of #1. B. There seems to be consensus on using a syntax with parentheses for = #1.=20 C. There is a lot of pushback on #2. D. The desired syntax in #2 would reduce future flexibility, as Larry = Garfield commented.=20 Given both of these sets of assertions I would ask the RFC's author and = proponents what would be a worse outcome? X. Getting typehints for nullable intersection types added to PHP, but = not the desired syntax? Y. Not getting typehints for nullable intersection types added to PHP?=20= When answering please consider that #X is the outcome that would not = preclude possibly getting #2 at a future date. --------- Also, the entire discussion has claimed a "need" for nullable = intersection types but AFAIIK they have been presented in completely = abstract terms; i.e. no one has presented any real-world scenarios where = they would actually use nullable intersection types. =20 It might be helpful =E2=80=94 or at least it would be for me =E2=80=94 = if the RFC could add two or three real-world example use-cases where the = author and proponents would actually like to use nullable intersection = types in their future PHP code. =20 #jmtcw -Mike= --Apple-Mail=_942F17DA-DD4B-4B85-8053-A97A8A451569--