r/PHPhelp • • Apr 14 '26

New, better linter for php.

https://github.com/anttiryt/phplint

I got tired of stan being slow and normal linter not figuring out uninitialized variables which, as we know, crash php on php8.

0 Upvotes

16 comments sorted by

6

u/oshjosh26 Apr 14 '26

Honestly, if you want more speed why not contribute to this project https://mago.carthage.software/

It's written in rust, and jetbrains is sponsoring it. I've been using it and it's great and 2.0 will include an LSP.

8

u/allen_jb Apr 14 '26

Not to detract from the work you've put in here, but primarily to point out to anyone who might not be aware:

PHPStan does a lot more than basic linting tho (and can be extended even further with a wide range of additional rulesets available on Packagist, or create your own).

If you're experiencing performance issues I'd suggest ensuring you have a result cache configured: https://phpstan.org/user-guide/result-cache

If you're using CI tools like GitHub Actions these often have caching systems that can allow you to save the PHPStan result cache across runs.

If PHPStan doesn't already do what you want, I'd suggest looking at creating custom PHPStan rules over writing your own tools.

(Most other static analysis tools have similar features)

7

u/colshrapnel Apr 14 '26 edited Apr 14 '26

uninitialized variables which, as we know, crash php on php8

O RLY? I believe you may be mistaken regarding this matter

3

u/dutchman76 Apr 14 '26

Was scratching my head at that comment too

2

u/colshrapnel Apr 14 '26

Honest question, doesn't PHPStorm do all these checks just as you type?

5

u/gaborj Apr 14 '26

But this one has a rocker in the readme, how cool that is

4

u/Anxious-Insurance-91 Apr 14 '26

You'd be surprised how many people don't use Jetbrains IDEs and always refused to use them even if they bring such a big development seedup

2

u/mrjuoji Apr 14 '26

tbh, in my case, doing freelance work, i don't only write php , but at my last job we had php storm, and yeah, their product is good out of the box, like, it's a great tool,

but as a freelance i can't justify the cost, so a modded out vscode does the work, it's not as good, but it's like, 8/10 if that make sense

-5

u/Anxious-Insurance-91 Apr 14 '26

Most of their tools are free, they do say for non-commercial use, but I yet to receive a law enforcement agency knocking at my door 😅

2

u/Own-Perspective4821 Apr 14 '26

I wonder how you manage to do that, as there is no community edition for PHPStorm.

1

u/dragonmantank Apr 15 '26

VSCode is pretty good, just saying.

0

u/[deleted] Apr 14 '26

[deleted] — view deleted comment

3

u/danabrey Apr 14 '26

It's like £6 per month after a few years of license discounts. If you're working for a company and they won't pay for it, pretty shoddy company.

0

u/[deleted] Apr 14 '26

[deleted] — view deleted comment

1

u/danabrey Apr 14 '26

Sure, I get that. I can understand a hobbyist not bothering - there is a student licence if you're in college or similar. But for a self employed person, it should be around 1-2 hours of your hourly rate cost per year.

Phpstorm saves me WAY more time than that.

2

u/Anxious-Insurance-91 Apr 14 '26

Yeah well what people don't understand is that they could have made a lot more money if their IDE would have saved them time, especially in freelancing

3

u/[deleted] Apr 14 '26

[removed] — view removed comment

2

u/danabrey Apr 14 '26

Linters can totally act on save within an IDE, and that's often more than enough for a single-person project without using a CI tool.