Hacker News new | ask | show | jobs
by duskwuff 648 days ago
> ...I envy TypeScript, though. I wish PHPDoc was more powerful... I just want ADTs.

You can get a lot of the way there with static analyzers like Psalm (psalm.dev). Annotate your functions/classes with detailed types in PHPDoc, and it'll verify that your code behaves consistently with those types.