Typestate-Oriented programming in PHP? Possible?
https://typephp.dev/blog/making-legal-states-impossible-in-place-typestates-in-pure-php

TypePHPMaking Illegal States Impossible: In-Place Typestates in Pure PHP | TypePHPWhy C#, Java, and Rust cannot mutate generic types in-place, the deep computer science behind Typestate-Oriented Programming, and how TypePHP reifies mutable generics at runtime in pure PHP.