调用php -l检查php文件的语法.
有没有办法检查未定义的功能?我不需要它来处理在运行时定义的函数或动态调用.
显然调用文件是行不通的:我需要检查整个文件,而不仅仅是检查执行的分支.请参阅以下示例.
myfile.php:
function imhere () {}
Run Code Online (Sandbox Code Playgroud)
main.php:
require_once 'myfile.php';
if (true) {
imhere();
}
else {
imnhothere(); // I need to get a warning about this
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
167 次 |
| 最近记录: |