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

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.