Tool to check your PHP files from parse errors before commit.
Clone or download
ReekenX Merge pull request #11 from wesclemens/master
Refactored code to be more functional and reusable
Latest commit 9c4c60b Jun 22, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Updated all project files Nov 12, 2010
README.rst Added silent mode to remove verbose messages Jun 21, 2016
pre-commit Script now checks staged version of file instead of on disk version Jun 21, 2016


GIT - PHP check

Author: Remigijus Jarmalavicius <remigijus(a)>
Thanks to:Vytautas Povilaitis <php-checker(a)>
Thanks to:hkdobrev (
Thanks to:Cliff Seal (
Thanks to:Dave Barnwell (


GIT hook for PHP parse errors checking before commit.

If you looking same thing for Mercurial DCVS, check this out:

How to install

To install hook, copy pre-commit file to your project .git/hooks/pre-commit:

$ cp pre-commit .git/hooks/pre-commit; $ chmod +x .git/hooks/pre-commit;

Now, when you will make some modifications for code and will try to commit, GIT will stop you and tells where problem exist.

Usage example

Example of PHP script beeing commited with PHP syntax errors:

Syntax errors found in file: cms/content.php

Found PHP parse errors: PHP Parse error: syntax error, unexpected ')' in /path/to/project/cms/content.php on line 39

Fix errors and commit again.


linter.php.silent : (type: boolean) Suppresses all messages that are not linter errors.


If you have found any bugs, please track them here:

Thanks for all peoples who made this tool better.