Quick recursive PHP file syntax check

May 10, 2016

I find it handy to run a PHP syntax (lint) check on files after resolving a merge conflict in git.

Here is a handy snippet that will run find every file in the current and sub-directories and run them through the PHP command line syntax checker.

find . -iname "*.php" -exec php -l {} \; | grep -i "Errors.parsing"
Leave a Reply

Your email address will not be published. Required fields are marked *