Syntax check for PHP

Sometimes you just want to check the syntax in a PHP file without running it. For this the good people developing PHP made the -l option. To use:

php -l <filename>

This will check the syntax of <filename> file. If there are no errors you will get: No syntax errors detected in <filename>

Tested with PHP v5.1.6

Comments are closed.