<?php
/*
/* this is a comment */
*/
?>
PHP 返回“语法错误”...这是使用多行注释的完全错误的方法吗?
有时我需要注释掉一大块代码来测试,而这个 block 有几百行,里面还有很多多行注释。
注释掉这个大块的最佳方式是什么?除了暂时从文件中删除它?
最佳答案
来自 PHP manual :
'C' style comments end at the first */ encountered. Make sure you don't nest 'C' style comments. It is easy to make this mistake if you are trying to comment out a large block of code.
<?php /* echo 'This is a test'; /* This comment will cause a problem */ */ ?>
:(
关于php - PHP 中多行注释内的多行注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6977568/