larry*wei 2008-12-18 19:39 采纳率: 0%
浏览 355
已采纳

是否有 PHP 文件的静态代码分析器(如 Lint) ? [打烊]

Is there a static code analyzer for PHP files? The binary itself can check for syntax errors, but I'm looking for something that does more, like unused variable assignments, arrays that are assigned into without being initialized first, and possibly code style warnings. Open-source programs would be preferred, but we might convince the company to pay for something if it's highly recommended.

转载于:https://stackoverflow.com/questions/378959/is-there-a-static-code-analyzer-like-lint-for-php-files

  • 写回答

13条回答 默认 最新

  • bug^君 2008-12-18 22:02
    关注

    Run php in lint-mode from the command line to validate syntax without execution:

    php -l FILENAME

    Higher-level static analyzers include:

    Lower-level analyzers include:

    Runtime analyzers, which are more useful for some things due to PHPs dynamic nature, include:

    The documentation libraries phpdoc and doxygen perform a kind of code analysis. Doxygen, for example, can be configured to render nice inheritance graphs with graphviz.

    Another option is xhprof, which is similar to xdebug, but lighter, making it suitable for production servers. The tool includes a PHP-based interface.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(12条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏