This is going to sound stupid, but if you don’t have rock solid unit tests in place, one of the things you should be doing is running PHP Lint.
What is PHP Lint?
Simply stated, it checks your php file for syntax errors. How many times have you forgotten a semi-colon, or had unmatched curly braces?
How do I run PHP Lint?
It is very easy to run from the command line
php -l your_php_file.php
Using GIT? You should setup a pre-commit hook to always do this so you don’t push something bad into the repo. I am guilty of doing this in the past. 🙁
Here is a great post by Travis Swicegood about setting this up.
One thing to remember is that you also have to make the script executable.
chmod 744 .git/hooks/pre-commit