如何使用php_codesniffer进行升级和兼容性检查(PHP 5.2与PHP 5.4)


How to use php_codesniffer for upgrading and compatibility check (PHP 5.2 against PHP 5.4)

我正在做一个PHP 5.2版本的PHP项目。现在我想升级我的项目使用PHP版本5.4。我安装了php 5.4,并将我的项目部署为使用php 5.4。现在有什么工具来检查语法错误或编码标准或兼容性检查PHP 5.4?

如果我使用php_codesniffer呢?如果我从PHP 5.2升级到PHP 5.4,我可以使用php_codesniffer检查类型兼容性吗?

是的,这当然是可能的。从Wim Godden安装PHP_CodeSniffer的PHPCompatibility标准:

https://github.com/wimg/PHPCompatibility

在这里阅读更多信息:

http://techblog.wimgodden.be/2012/03/04/php-5-4-compatibility-checks-using-php_codesniffer/

这真的很简单,安装PHP_CodeSniffer和PHPCompatibility标准,然后在你的代码库上运行它。