Re: [RFC] Nullable intersection types

From: Date: Sat, 24 Jul 2021 21:03:57 +0000
Subject: Re: [RFC] Nullable intersection types
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-115579@lists.php.net to get a copy of this message
On Fri, Jul 23, 2021, 11:58 Nicolas Grekas <nicolas.grekas@gmail.com> 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. > Given the discussion, I think it might be better to remove all other syntax alternatives other than (X&Y)|null. There are persons here that mentioned they wish to wait for 8.2 than agree with 2/3 on the feature where the syntax might not be the most forward compatible one. One alternative could be to agree on a voting scheme where there could be 3 options: - No. - Yes, but only with (X&Y)|null. - Yes, any syntax, with additional vote on preferred syntax aiming for 2/3 on the second or third option. Regards, Alex

« previous php.internals (#115579) next »