Hacker News new | ask | show | jobs
by Master_Odin 2416 days ago
phpstan, phan, and psalm all exist and can provide these sorts of static analysis checks.
1 comments

They do static analyses that go beyond type checking. I have not tried phan and psalm, but the last time I used phpstan its type analysis threw false positives because it was using incorrect assumptions. So my impression is that phpstan lacks the rigor of a true compiler‘s type checker phase.

In my opinion, the PHP distribution shipping an official type checker which does nothing other than verify type correctness based on the information in the code would be much more useful. Kind of like `php -l`.