Re: Single-line comment problem
| From: | Johannes Schlüter | Date: | Thu, 08 Jul 2010 23:00:55 +0000 |
| Subject: | Re: Single-line comment problem | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49016@lists.php.net to get a copy of this message | ||
On Fri, 2010-07-09 at 00:49 +0400, jvlad wrote:
> >"Scott MacVicar" wrote:
> >Yeah because /* */ has a clear end where // and # doesn't.
> >
> >- S
>
>
> Shouldn't the end of the line be always considered as a true end of the
> one-line comment?
> In other words, I think it always has a clear end too.
> Similarly, lexer always regognizes the strings - their start and the end so
> it could ignore the tags in them too.
> Seems the only problem is BC that shouln't be broken. At least not before
> v6.
<h1><?php //some comment ?></h1>
is an absolutely valid reason to use single line comments which end
at ?>. I don't think there is a strong enough arguement to change that
part of the syntax in any release. Yes it might be confusing some times
but it is well defined and established.
johannes
> -j
>
>
>