PHP Parser : https://github.com/nikic/PHP-Parser
PHP-Parser is a PHP written in PHP Parser (supports PHP 5.4 and earlier), this special parser is ideal for static code analysis. The purpose of this tool is to simplify static code analysis and manipulation, and it enables programmers to programmatically process the code of any application.
PHPSandbox: https://github.com/fieryprophet/php-sandbox (Recommended learning: PHP programming from entry to proficiency)
PHPSandbox is a way to run PHP as a standalone process. It provides programmers with a kind of protection for peripheral scripts, such as errors, crashes, slow-running scripts, or scripts that are not suitable for running in the code, can be run as independent processes.
PHP Mess Detector: https://phpmd.org/
PHPMD This tool can detect some potential problems in PHP source code. For example:
Possible bugs Code that is not up to optimal standards Overly complex syntax Unused parameters, methods, properties
PHPCPD: https:/ /github.com/sebastianbergmann/phpcpd
PHPCPD is a tool that looks for similar patterns in code. Use it to identify where code has been copied or pasted in a code base. This is a very useful tool during the regular build process and will help the programmer analyze the code to avoid repeated function calls in the code base.
PHPCheckstyle : https://phpcheckstyle.github.io/
PHPCheckstyle is a tool to help PHP programmers check code and report errors, running on PHP 5.0 and later version. By calling PHPCheckstyle through an SVN hook script, you can force the code to comply with preset coding standards (such as the PEAR coding standard), which helps improve the overall code quality in multi-person collaboration projects.
Ubench: https://github.com/devster/ubench
Ubench is a development library used to evaluate PHP code execution time and memory usage efficiency.
PHP Analyzer: https://scrutinizer-ci.com/docs/tools/php/php-analyzer/
PHP Analyzer executes the same flow as the compiler Analysis, ensuring that the code executes tests on every line of every potential execution path. This special tool helps developers improve the quality of their code, thereby ensuring productivity.
The above is the detailed content of What tools can analyze php source code. For more information, please follow other related articles on the PHP Chinese website!