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

前端 未结 11 569
你的背包
你的背包 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:45

    PHP's documentation describes the different possibilities of comments. See http://www.php.net/manual/en/language.basic-syntax.comments.php

    But it does not say anything about differences between "//" and "#". So there should not be a technical difference. PHP uses C syntax, so I think that is the reason why most of the programmers are using the C-style comments '//'.

提交回复
热议问题