note 28665 added to language.basic-syntax.comments
| From: | mattb at columbia dot edu | Date: | Mon, 20 Jan 2003 09:41:16 +0000 |
| Subject: | note 28665 added to language.basic-syntax.comments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42416@lists.php.net to get a copy of this message | ||
The whole // behavior is *really* annoying:
<?php
//echo '<?xml ... ?>'; // Huh?
?>
This will actually output:
'; // Huh?
?>
Because the close tag is found within the // comment. This is totally counterintuitive, so watch out
for it. (IMO, this is either bad design or probably a hard-to-fix parser bug that turned into a
"feature".)
It seems there is only one convenience this presents (i.e., for one-liner php excerpts in HTML) at
the bane of good commenting behavior (i.e., that // should be used for most comments, and /* */
should be researved for headers or commenting out large blocks of code when testing).
My advice: BEWARE BEWARE BEWARE!
--
http://www.php.net/manual/en/language.basic-syntax.comments.php
http://master.php.net/manage/user-notes.php?action=edit+28665
http://master.php.net/manage/user-notes.php?action=delete+28665
http://master.php.net/manage/user-notes.php?action=reject+28665