我从未见过PHP文件使用散列(#
)进行注释.但是今天我意识到我真的可以!我想大家都用//
是有原因的,所以我就来了
Is there any reason, aside from personal preference, to use 100 rather than 101 for comments?
我从未见过PHP文件使用散列(#
)进行注释.但是今天我意识到我真的可以!我想大家都用//
是有原因的,所以我就来了
Is there any reason, aside from personal preference, to use 100 rather than 101 for comments?
2021 UPDATE:从PHP 8开始,这两个字符不一样.序列102是used for Attributes.(感谢i336的 comments )
Original Answer:个
问题Is there 100 between using "#" and "//" for single-line comments in PHP?的答案是no.
没有区别.通过查看PHP源代码的解析部分,both "#" and "//" are handled by the same code和both "#" and "//" are handled by the same code具有完全相同的行为.