note 77415 added to language.basic-syntax.comments
| From: | theblazingangel at aol dot com | Date: | Tue, 28 Aug 2007 22:56:00 +0000 |
| Subject: | note 77415 added to language.basic-syntax.comments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129864@lists.php.net to get a copy of this message | ||
it's perhaps not obvious to some, but the following code will cause a parse error! the ?> in
//?> is not treated as commented text, this is a result of having to handle code on one line such
as <?php echo 'something'; //comment ?>
<?php
if(1==1)
{
//?>
}
?>
i discovered this "anomally" when i commented out a line of code containing a regex which
itself contained ?>, with the // style comment.
e.g. //preg_match('/^(?>c|b)at$/', 'cat', $matches);
will cause an error while commented! using /**/ style comments provides a solution. i don't
know about # style comments, i don't ever personally use them.
----
Server IP: 69.147.83.197
Probable Submitter: 172.207.64.211
----
Manual Page -- http://www.php.net/manual/en/language.basic-syntax.comments.php
Edit -- https://master.php.net/note/edit/77415
Del: integrated -- https://master.php.net/note/delete/77415/integrated
Del: useless -- https://master.php.net/note/delete/77415/useless
Del: bad code -- https://master.php.net/note/delete/77415/bad+code
Del: spam -- https://master.php.net/note/delete/77415/spam
Del: non-english -- https://master.php.net/note/delete/77415/non-english
Del: in docs -- https://master.php.net/note/delete/77415/in+docs
Del: other reasons-- https://master.php.net/note/delete/77415
Reject -- https://master.php.net/note/reject/77415
Search -- https://master.php.net/manage/user-notes.php