Write your tests using #PHPUnit 12.x and run them using PHPUnit 7.5 - 12.x to verify cross-version compatibility.
Thanks to @jrf_nl and contributors!
1.x → supports PHPUnit 4.8–9.x
2.x → supports PHPUnit 5.7–10.x
3.x → supports PHPUnit 6.4–11.x (**)
4.x → supports PHPUnit 7.5–12.x (**)
https://github.com/yoast/phpunit-polyfills
https://github.com/sponsors/jrfnl
(**: except PHPUnit 10 for running tests)
