PHP多行注释内的多行注释 [英] PHP Multiple Line Comment inside Multiple Line Comment

查看:122
本文介绍了PHP多行注释内的多行注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php
/*
    /* this is a comment */
*/
?>

PHP返回语法错误 ...

使用多行注释的错误方法?

PHP returns "syntax error"...
Is this just a completely wrong way to use multiple line comment?

有时候,我需要注释掉一个很大的代码块进行测试,并且该块包含数百行,并且其中包含许多多行注释。

Sometimes I need to comment out a big block of code for testing, and this block contains hundreds of lines and there are many multiple line comments inside.

那么注释掉这个大块的最佳方法是什么?除了将其暂时从文件中删除以外?

So what's the best way to comment out this big block? besides removing it temporarily from the file?

推荐答案

PHP手册


'C'样式的注释以首先遇到* /。确保您
不要嵌套 C样式的注释。如果您
试图注释掉一大段代码,就很容易出错。

'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多行注释内的多行注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆