Sublime Forum

How are PHP files syntax checked?

#1

Hi!

I use the pylint plugin for my Python code and have been able to tweak it just right for my coding needs.

I notice that PHP seems to get checked somehow as well, since dumb things like leaving off a semi-colon get me an error indicator outline around the affected code.

Does anyone know where I can fine-tune the settings used during that check?

I’d like to get as much help in PHP as possible since I find debugging it at runtime to be a nightmare due to some of its “helpful” behaviours; like setting undeclared variables to NULL or 0 or “” etc.

Thanks,

S

0 Likes

#2

The PHP is checked using the command line PHP executable with the “-l” option. As far as I’m aware there’s very little (if anything) you can fine tune about this, as PHP’s linting is inbuilt to the PHP, and PHP as a language is pretty strict on its syntax. Variable typing is quite relaxed, but this checker just checks the syntax as far as I’m aware, which as I just said is quite strict.

Check out http://www.php.net/manual/en/features.commandline.options.php for an idea of how php -l works.

0 Likes