Hacker News new | ask | show | jobs
by karmakaze 1673 days ago
Super cool:

> Union Types - Combine several types into one union, which means that whatever input must match one of the given types: `function find(int|string $id)`

TypeScript and PHP have the distinct honor of being a popular language with ad-hoc union types (not the concrete subclass/enums that other languages seem to think are sufficient).