Run php in lint-mode from the command line to validate syntax without execution:
php -l FILENAME
Higher-level static analyzers include:
- php-sat - Requires http://strategoxt.org/
- PHP Mess Detector
Lower-level analyzers include:
Runtime analyzers, which are more useful for some things due to PHPs dynamic nature, include:
- Xdebug has code coverage and function traces.
- My PHP Tracer Tool uses a combined static/dynamic approach, building on Xdebug's function traces.
Another option is xhprof, which is similar to xdebug, but lighter, making it suitable for production servers. The tool includes a PHP-based interface.