PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments. For example:
The "one-line" comment styles only comment to the end of the line or the current block of PHP code, whichever comes first. This means that HTML code after // ... ?>
or # ... ?>
WILL be printed: ?> breaks out of PHP mode and returns to HTML mode, and //
or #
cannot influence that.
'C' style comments end at the first */
encountered. Make sure you don't nest 'C' style comments. It is easy to make this mistake if you are trying to comment out a large block of code.
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/language.basic-syntax.comments.php