On Sat, 2022-03-19 at 16:38 +0000, G. P. B. wrote: > DNF types are a way to mix intersection and union types together in a > single type. > For example: > - (A&B)|null > - (Traversable&Countable)|array
Hello George, I like your proposal. I would like to offer 2 suggestions however: 1. I think that syntax would be cleaner without the parentheses 2. [Future Scope] I would go against non-DNF types. DNF forms a nice two level structure that's easy to comprehend. Arbitrary expressions may be too much for runtime checks (correct me if I'm wrong) and will definitely have high cognitive complexity. And CNF would allow to form invalid types too easily like (Traversable|null)&Countable Best, Anton -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php