我可以使用哈希符号(#)在PHP中进行注释吗? [英] Can I use hash sign (#) for commenting in PHP?

查看:79
本文介绍了我可以使用哈希符号(#)在PHP中进行注释吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有看过使用哈希()进行评论的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.

除了个人偏好以外,是否有任何理由使用 // 而不是 >

推荐答案

问题的答案使用#和//用于PHP中的单行注释?

没有区别。通过查看PHP源代码的解析部分, #和//由相同的代码处理,因此具有完全相同的行为。

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.

这篇关于我可以使用哈希符号(#)在PHP中进行注释吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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