Is there any good Automatic Code check tool in PHP?

Source: Internet
Author: User
We often need to check the code when coding in php. Its built-in php-l function is too weak and can only be checked for syntax errors. What I need is a checking tool that can be used in the production environment, such as detecting useless variables or directly using uninitialized variables... we often need to check the code when coding in php. It comes php -lThe function is too weak. You can only check for syntax errors.
What I need is a checking tool that can be used in the production environment, such as detecting useless variables or directly using uninitialized variables, of course, you need to analyze potential error codes. It is best to detect some code style problems. In this way, some quality problems can be controlled during large-scale development.

For example, Lint is a tool set. In addition to the original C language version, it also has other versions to Implement CSS Lint and JS Lint. I Don't Know If php has similar tools.

Reply content:

We often need to check the code when coding in php. It comesphp -lThe function is too weak. You can only check for syntax errors.
What I need is a checking tool that can be used in the production environment, such as detecting useless variables or directly using uninitialized variables, of course, you need to analyze potential error codes. It is best to detect some code style problems. In this way, some quality problems can be controlled during large-scale development.

For example, Lint is a tool set. In addition to the original C language version, it also has other versions to Implement CSS Lint and JS Lint. I Don't Know If php has similar tools.

Of course.

PHP Mess Detector (http://phpmd.org /)

The PHP project Health Check Tool checks PHP code based on your set standards (such as the size of a single file code, the number of unused parameters, and the number of unused methods) and generates an alarm when the preset standard is exceeded.

PHP Copy Paste Detector (https://github.com/sebastianbergmann ...)

Check for redundant code

PHP Dead Code Detector (https://github.com/sebastianbergmann ...)

Check the method that has never been called.

PHP Code Sniffer (http://pear.php.net/package/PHP_CodeS ...)

The old code formatting tool, written in PHP, And the Pear package, can be hack by itself and can be integrated into the command line. I have been using PHP Code Beautifier, only Windows GUI, Windows CMD is very difficult to use, and I plan to switch to PHP CS

You can also use jenkins to integrate the above tools in the form of plugins for continuous integration: http://jenkins-php.org/

You can also use xinc + phing to integrate with the above tools for continuous integration of automated packaging release: http://code.google.com/p/xinc/

PHPLint http://www.icosaedro.it/phplint/

Is it what you want?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.