> On 23/07/2021 10:58, Nicolas Grekas wrote:
> > Hi everyone,
> > I wrote everything down about the reasons why here:
> > https://wiki.php.net/rfc/nullable_intersection_types
> IMO we should require brackets and forbid not using them when combining
> unions and intersections.
> These types are already going to be confusing enough and we can likely
> save a fair amount of confusion and pain down the line by requiring the
> explicit brackets.
> Without wanting to bikeshed, let's just make sure we're set on ()
> because whatever we choose here will be the defacto mechanism for
> declaring sub-types in PHP for the rest of eternity so it would need to
> be maximally compatible with everything we might want to do with them.
This is also my preference to have it (A&B)|null - It is the least
"disruptive" change for this late stage of the release cycle and leaves the
most potential for future improvements.