php - PHP 中多行注释内的多行注释

标签 php comments

<?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/

相关文章:

javascript - Bootstrap : Show modal window on image click in a loop

ide - 富文本有助于注释代码吗?

flutter - 如何在 android studio 的注释行中添加代码引用?

python - 如何使用 ruamel.yaml 添加评论

php - MongoDB + PHP : support for SSL?

继承方法的phpdoc

php - 在没有for循环的情况下在php中组合数组

php - Laravel 4 ssl 子域重定向到主域

sql - 记录数据库

java - 如何摆脱 XXX 自动生成的方法 stub