Re: Single-line comment problem
| From: | Scott MacVicar | Date: | Thu, 08 Jul 2010 03:18:30 +0000 |
| Subject: | Re: Single-line comment problem | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49012@lists.php.net to get a copy of this message | ||
The scanner is looking for \r \n % if ASP tags are enabled or ?> before it marks the end of the
comment.
Take the following
<?php
echo 'PHP';
// echo $moo; ?> I am HTML, hear me roar!
Parsing ends with ?> regardless if its a comment or not but its not context sensitive. It
can't understand that its within a string.
- S
On Jul 7, 2010, at 7:26 PM, Shijiang wrote:
> Hi
> I'm not sure whether it's really a bug.
> The following sample code will emit a parse error.
> <?php
> if(true){
> //echo '<?php date('Y-m-d H:i:s'); ?>';
> echo 'afafa';
> }
> ?>
>
> The parser treate the PHP tag within the commented line as a normal tag .
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>