Static Analysis

You can use HipHop-PHP to do static analysis

$ find /var/www -name '*.php' | grep -v phpunit > /tmp/hphp/files.txt
$ hhvm --hphp -t analyze \
  --input-list=/tmp/hphp/files.txt \
  --include-path="/var/www/include" \
  --output-dir=/tmp/hphp \
  --gen-stats=1 \
  --keep-tempdir=1 

It will find these sorts of things