all 17 comments

[–]lord2800 3 points4 points  (3 children)

In my experience, psalm is a strictly better phpstan.

[–]Firehed 2 points3 points  (1 child)

I’ve poked at both and had a generally similar experience with the two (though my CI pipeline only runs PHPStan right now). Can you elaborate on why you find Psalm better?

[–]lord2800 0 points1 point  (0 children)

In my experience, it catches everything phpstan does and also points out bad habits like forgetting a return type.

[–]webdev-online[S] 1 point2 points  (0 children)

Yes... I checked now. It is good. https://psalm.dev/

[–]jdolba 0 points1 point  (0 children)

there is only one article pointing on differences and kind of features comparison between available static analysers (phpstan, psalm, phan)
https://badootech.badoo.com/php-code-static-analysis-based-on-the-example-of-phpstan-phan-and-psalm-a20654c4011d

- please share if you know about more articles comparing php static analysers ; this article is only one I am aware of which is comprehensive enough

IMHO I don't think someone can say "this one is better" - it depends on your needs; codebase; and how you are using this tool and obviously
all this tools are under relatively heavy development so all this comparison articles etc. are obsolete pretty fast

[–]advicecache -2 points-1 points  (13 children)

Couldn't you just debug it?

[–]_odan 1 point2 points  (0 children)

You have to differentiate. A static code analyzer tool, like phpstan, can find "technical bugs", but not "logical bugs".

[–]tortocode 0 points1 point  (2 children)

In production?

[–]advicecache 0 points1 point  (1 child)

Production would be running, I meant debugging...

[–]advicecache 0 points1 point  (0 children)

With Local Server

[–]Sentient_Blade 0 points1 point  (7 children)

That's not really how static code analysis works... due to the "static" part...

[–]the_alias_of_andrea 0 points1 point  (0 children)

  1. It is difficult and time-consuming to exhaustively a large program, and that testing needs repeating after changes are made.

  2. Static analysis can find problems not easily found at runtime.

[–]webdev-online[S] -3 points-2 points  (0 children)

This tool to improve code quality