我认为这可能有点困难的分析仪给予警告。例如,您给出的代码可能与帮助register_globals配合使用。此外,它可能在包括此文件的某个其他文件中定义。由于这些原因,PHP文件应该分析与其他文件的完整上下文,这是真的可靠,PHP /服务器配置也应该是可用或定义到分析机制。
也就是说,你确定phplint不做你想做什么吗?
源代码什么意思、有一个online validator,你可以使用来测试它。给定输入:
echo $foo;
结果是:
php怎么运行代码。echo $foo;
\_ HERE
==== 3: ERROR: variable `$foo' has not been assigned
怎么查看源代码,END parsing of test-qBlPWw
==== ?: notice: unused package `dummy.php'
==== ?: notice: unused module `standard'
php跳转语句?Overall test results: 1 errors, 0 warnings.
而使用isset()它没有发现任何问题。
编辑:所以对于其他测试用例:
源代码文件,if ($foo == 'bar') echo $foo;
在Linux Mint 8上的响应是:
$ src/phplint test.php
/home/vadmin/phplint/phplint-pure-c-1.0_20110223/test.php:3: ERROR: variable `$foo' has not been assigned
/home/vadmin/phplint/phplint-pure-c-1.0_20110223/test.php:3: Warning: comparing (unknown) == (string): cannot check the comparison between unknown types
Overall test results: 1 errors, 1 warnings.
并与此:
$foo = '1';
if ($foo == 1) echo $foo;
它是:
$ src/phplint test.php
/home/vadmin/phplint/phplint-pure-c-1.0_20110223/test.php:6: ERROR: comparing (string) == (int)
Overall test results: 1 errors, 0 warnings.
所以不是它的工作,它应该,并报告问题正确吗?
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态