[PHP Tool recommended]0001.7 Tools for parsing and parsing code

Source: Internet
Author: User
Tags coding standards php source code

Introduction: PHP has become one of the most popular programming languages , but many PHP programmers fret that they can't find the right tools to help analyze and parse PHP code. Today SD is to introduce a few very good tools to help programmers improve their efficiency, come together to see it!

Tool Index:

    • PHP Parser
    • Phpsandbox
    • PHP Mess Detector
    • Phpcpd
    • Phpcheckstyle
    • Ubench
    • PHP Analyzer

PHP Parser

Php-parser is a PHP parser written in PHP (PHP 5.4 and earlier), a special parser ideal for static code analysis. The purpose of the tool is to simplify static code analysis and manipulation, which enables programmers to programmatically manipulate the code of any application.

Phpsandbox

Phpsandbox is a way to run PHP as a standalone process. It provides programmers with the protection of a perimeter script, such as errors, crashes, slow scripts, or scripts that are not suitable for running in code, and can be run as standalone processes.

PHP Mess Detector

PHPMD This tool can detect some potential problems in PHP source code. For example:

    • Bugs that may exist
    • Code that is not up to the best standard
    • Too complex a grammar
    • Parameters, methods, properties that have never been used

PHPCPD

PHPCPD is a tool that looks for similar patterns in code and uses it to identify where code is copied or pasted in the code base. This is a very useful tool in the regular build process that helps programmers analyze code to avoid repeating calls to functions in the code base.

Phpcheckstyle

PhpcheckStyle is a tool that helps PHP programmers to check code and report errors, running in PHP 5.0 and later. Invoking Phpcheckstyle via the SVN hook script can force code to conform to pre-programmed coding standards (such as the Pear encoding standard), helping to improve the overall quality of the code in a multi-person Collaborative project .

Ubench

Ubench is a development library that evaluates PHP code execution time and memory usage efficiency. Here's how to use it:

require_once' Src/ubench.php ';$bench=NewUbench;$bench-start ();//Execute Some code$bench-End();//Get elapsed time and memoryEcho $bench->gettime ();//156ms or 1.123sEcho $bench->gettime (true);//elapsed Microtime in floatEcho $bench->gettime (false, '%d%s ');//156ms or 1sEcho $bench->getmemorypeak ();//152B or 90.00Kb or 15.23MbEcho $bench->getmemorypeak (true);//memory Peak in bytesEcho $bench->getmemorypeak (false, '%.3f%s ');//152B or 90.152Kb or 15.234mb//Returns the memory usage at the end MarkEcho $bench->getmemoryusage ();//152B or 90.00Kb or 15.23Mb

PHP Analyzer

PHP Analyzer performs the same flow analysis as the compiler , ensuring that the code performs tests on every line of the potential execution path. This special tool helps developers improve their code quality to ensure productivity.

This site article is for baby bus SD. Team Original, reproduced must be clearly noted: (the author's official website: Baby bus )
Reprinted from "Baby bus Superdo Team" original link: http://www.cnblogs.com/superdo/p/4808189.html

[PHP Tool recommended]0001.7 Tools for parsing and parsing code

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.