我可以注释掉有其他注释的行吗?
/*
* comment 1
*/
$var = 0;
$if();
/*
* comment 2
*/
$var2 = 2;
有没有办法把所有这些行一起注释掉? 我经常有一个很长的函数或逻辑,并且想注释掉其余部分以进行测试。
最佳答案
您是否考虑过将代码放在 if(0) block 中来跳过代码?
例如:
<?php
if( 0 ) {
print("This code is 'commented' out");
... other commented out code is here ...
}
?>
关于php - 用 PHP 注释掉其他注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11247561/