SublimeLinter-php or SublimeLinter-phplint
Asked Answered
K

2

9

I'm a new user of Sublime Text / Sublime Text 3 on OS X.

I installed the plugin SublimeLinter. I also installed xampp on my local machine.

Which should I install next for the linter to work on PHP? SublimeLinter-php or SublimeLinter-phplint? What's the difference of each plugin?

Kooky answered 4/5, 2014 at 8:35 Comment(0)
G
6

The difference lies in the linter they use: SublimeLinter-php uses php -l, SublimeLinter-phplint uses phplint.

Gangway answered 4/5, 2014 at 10:2 Comment(2)
Ok, after hours of playing with it I finally get it. I thought they are prerequisites to each other. I guess I'll use SublimeLinter-php since I already have PHP on my local machine. Thank you!Kooky
@Kooky - The new coders in our team were wondering about the same question as you some time ago, so we installed both SublimeLinter-php and SublimeLinter-phplint on everyone's machines to compare them. To our surprise, the two linters were very different, with SublimeLinter-phplint finding numerous errors in every file (even files that came from official sources) while SublimeLinter-php was a lot more easy-going. See more info and an example in my answer below.Brigid
B
6

To supplement the answer from @idleberg above, the two linters are very different in the number and type of errors that they generate.

We installed both, and ran them side-by-side for a month. Our observations were as follows.

  • SublimeLinter-php tagged only the errors that were genuinely problematic. We found the linter useful and have continued to use it.

  • SublimeLinter-phplint, by contrast, flagged numerous errors in every file, most of which did not affect the functioning of the file. It seemed that SublimeLinter-phplint was either generating false positives or took a very prescriptive / academic perspective of php. Advanced users may benefit from the comprehensive reporting in SublimeLinter-phplint, but less advanced users are likely to find the lints overwhelming and impractical.

Here is an example. The file phpmyadmin.config.inc.php comes from https://docs.phpmyadmin.net/en/latest/config.html and is installed by default if you run brew install phpmyadmin.

SublimeLinter-php finds no fault with the file, but SublimeLinter-phplint identifies four errors - as shown in the screenshot below.

enter image description here

Bottom line: If you are fairly new to coding, start with SublimeLinter-php - it's easy to use and practical.

Brigid answered 13/9, 2018 at 11:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.