
php有哪几种毛病提醒
1.notice : 注重
2.waring : 正告 (引荐进修:PHP视频教程)
3.error : 毛病
PHP中都有哪几种查错要领?
1、语法搜检--php设置文件里,把毛病显现选项都翻开或许代码最先部份,加error_reporting(E_ALL)
2、逻辑搜检--设置断点,在断点前写日记 error_logs($message);exit();
3、HTTP调试--用抓包东西或许firebugs东西跟踪代码运转的全过程
PHPCS是代码检测范例水平的东西
PHP代码范例有PSRs,为了能做到代码范例的自动化搜检和修复,就需要用到PHPCS了。
常用命令
搜检单个文件:phpcs /path/to/code
搜检目录下的文件:phpcs /path/to/code/
检察已装置的规范:phpcs -i
设置默许搜检规范:phpcs --config-set default_standard /path/to/standard_file
检察设置:phpcs --config-show
指定报告花样:phpcs --report=summary /path/to/code ;可用的报告花样有full, xml, checkstyle, csv, json, emacs, source, summary, diff, svnblame, gitblame, hgblame, notifysend,默许为full
检察协助:phpcs -h
自动修复:phpcbf /path/to/code
细致的使用说明见官方wiki
以上就是php代码毛病检测与校验的细致内容,更多请关注ki4网别的相干文章!