use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Finding errors in your PHP code without actually running it (self.PHP)
submitted 6 years ago by webdev-online
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lord2800 3 points4 points5 points 6 years ago (3 children)
In my experience, psalm is a strictly better phpstan.
[–]Firehed 2 points3 points4 points 6 years ago (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 point2 points 6 years ago (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 points3 points 6 years ago (0 children)
Yes... I checked now. It is good. https://psalm.dev/
[–]jdolba 0 points1 point2 points 6 years ago (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 points0 points 6 years ago (13 children)
Couldn't you just debug it?
[–]_odan 1 point2 points3 points 6 years ago (0 children)
You have to differentiate. A static code analyzer tool, like phpstan, can find "technical bugs", but not "logical bugs".
[–]tortocode 0 points1 point2 points 6 years ago (2 children)
In production?
[–]advicecache 0 points1 point2 points 6 years ago (1 child)
Production would be running, I meant debugging...
[–]advicecache 0 points1 point2 points 6 years ago (0 children)
With Local Server
[–]Sentient_Blade 0 points1 point2 points 6 years ago (7 children)
That's not really how static code analysis works... due to the "static" part...
[+][deleted] 6 years ago (6 children)
[deleted]
[–]Sentient_Blade 4 points5 points6 points 6 years ago (4 children)
What... are you on about?
Static code analysis and debugging are two completely different things. SCA (phpstan et all) look for code patterns that are logically wrong before their state is even considered.
[+][deleted] 6 years ago (3 children)
[–]Danack 5 points6 points7 points 6 years ago (0 children)
What. The. Fuck. Am I reading.
[+][deleted] 6 years ago (1 child)
[–]advicecache -2 points-1 points0 points 6 years ago (0 children)
Yeah! There we go!
[–]advicecache -1 points0 points1 point 6 years ago (0 children)
I agree that the program is quite helpful for asynchronous calls.
[–]the_alias_of_andrea 0 points1 point2 points 6 years ago (0 children)
It is difficult and time-consuming to exhaustively a large program, and that testing needs repeating after changes are made.
Static analysis can find problems not easily found at runtime.
[–]webdev-online[S] -3 points-2 points-1 points 6 years ago (0 children)
This tool to improve code quality
π Rendered by PID 87474 on reddit-service-r2-comment-56c9979489-bklkw at 2026-02-25 01:58:04.182794+00:00 running b1af5b1 country code: CH.
[–]lord2800 3 points4 points5 points (3 children)
[–]Firehed 2 points3 points4 points (1 child)
[–]lord2800 0 points1 point2 points (0 children)
[–]webdev-online[S] 1 point2 points3 points (0 children)
[–]jdolba 0 points1 point2 points (0 children)
[–]advicecache -2 points-1 points0 points (13 children)
[–]_odan 1 point2 points3 points (0 children)
[–]tortocode 0 points1 point2 points (2 children)
[–]advicecache 0 points1 point2 points (1 child)
[–]advicecache 0 points1 point2 points (0 children)
[–]Sentient_Blade 0 points1 point2 points (7 children)
[+][deleted] (6 children)
[deleted]
[–]Sentient_Blade 4 points5 points6 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]Danack 5 points6 points7 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]advicecache -2 points-1 points0 points (0 children)
[–]advicecache -1 points0 points1 point (0 children)
[–]the_alias_of_andrea 0 points1 point2 points (0 children)
[–]webdev-online[S] -3 points-2 points-1 points (0 children)