dongshandun4363
2012-02-01 09:41
浏览 58
已采纳

我可以使用哈希符号(#)在PHP中进行注释吗?

I have never, ever, seen a PHP file using hashes (#) for commenting. But today I realized that I actually can! I'm assuming there's a reason why everybody uses // instead though, so here I am.

Is there any reason, aside from personal preference, to use // rather than # for comments?

图片转代码服务由CSDN问答提供 功能建议

我从未见过使用哈希()进行评论的PHP文件 。 但是今天我意识到我其实可以! 我假设有一个原因,为什么每个人都使用 // ,所以我在这里。

除了个人喜好,还有什么理由 ,使用 // 而不是进行评论?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

11条回答 默认 最新

  • dpvmjk0479 2012-02-01 09:53
    已采纳

    The answer to the question Is there any difference between using "#" and "//" for single-line comments in PHP? is no.

    There is no difference. By looking at the parsing part of PHP source code, both "#" and "//" are handled by the same code and therefore have the exact same behavior.

    评论
    解决 无用
    打赏 举报
查看更多回答(10条)

相关推荐 更多相似问题