PHPCompatibility检测php版本语法兼容

直接上步骤:

 1 cd /datas/htdocs/
 2 mkdir PHPCompatibility
 3 cd PHPCompatibility/
 4 curl -s http://getcomposer.org/installer | php
 5 ./composer.phar require "squizlabs/php_codesniffer=2.*"
 6 cd vendor/squizlabs/php_codesniffer/CodeSniffer/Standards
 7 git clone https://github.com/wimg/PHPCompatibility.git
 8 cd /datas/htdocs/PHPCompatibility/
 9 ./vendor/bin/phpcs -i
10 ./vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 7.1 /datas/htdocs/thinkphp/

 上面第10行是那thinkphp做测试,结果类似:

1 FILE: ...s/htdocs/thinkphp/Library/Vendor/TemplateLite/class.compiler.php
2 ----------------------------------------------------------------------
3 FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
4 ----------------------------------------------------------------------
5  159 | ERROR   | preg_replace() - /e modifier is deprecated since PHP
6      |         | 5.5 and removed since PHP 7.0
7 ----------------------------------------------------------------------

更多PHPCompatibility相关内容,请参考 https://www.sitepoint.com/quick-intro-phpcompatibility-standard-for-phpcs-are-you-php7-ready/

---------------------2017-07-18-----------------------

提供一个压缩包,直接解压可用 https://pan.baidu.com/s/1c1JX5DY

转载于:https://www.cnblogs.com/chanAndy/p/6894993.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值