Lots of people, particularly Laravel people, are doing static analysis with tools like PHPStan or Psalm. Over time there have been more and more type-oriented features introduced to the language too. Obviously you can't catch everything, but it's a dynamic language so that's the trade off you've signed up for.