PhpStorm可以区分if语句中未执行的部分


PhpStorm can i distinguish not executed part of if statement?

对于给定的代码:

if(false){
something_not_executed();
}else{
something_executed();
}

PhpStorm能在调试器介入后以某种方式区分(风格不同)未执行的代码部分吗?

您有两个选项:

1) 使用phpunit为代码编写一个适当的测试,并使用代码覆盖率运行它

2) 在if语句的任一侧设置一个断点,然后您就会知道哪一侧正在运行,因为它将在该点停止。