Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top