Can I use a hash sign (#) for commenting in PHP?

前端 未结 11 705
你的背包
你的背包 2021-01-31 13:07

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

11条回答
  •  你的背包
    2021-01-31 13:23

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

    I came here for the answer myself, and its good to know there is NO code difference.

    However, preference-wise one could argue that you'd prefer the 'shell->perl->php' comment consistency vs the 'c->php' way.

    Since I did approach php as a poor man's webby perl, I was using #.. and then I saw someone else's code and came straight to SO. ;)

提交回复
热议问题