This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 132629 - Editor does not highlight "//?>" as comment
Summary: Editor does not highlight "//?>" as comment
Status: VERIFIED INVALID
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 131609
  Show dependency tree
 
Reported: 2008-04-11 15:03 UTC by Victoria Zhukovskaya
Modified: 2008-04-14 15:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victoria Zhukovskaya 2008-04-11 15:03:16 UTC
build #2006, 11 April

Source code:
        <?php
            // put your code here
        //?>

Result

Editor does not highlight "//?>" as comments
and  sense this tag as not commented

So it may be couse of errors after this string.
Comment 1 Victoria Zhukovskaya 2008-04-11 15:05:25 UTC
the same situation for //<?php
Comment 2 Petr Pisl 2008-04-14 07:43:15 UTC
This is strange behavior of the php runtime, where the end delimiter ?> is active even in the comments. Our editor has
to reflect the runtime. See comments in http://us2.php.net/manual/en/language.basic-syntax.comments.php.

Regarding //<?php, this is treated as really php comment so it depends where it is. If it located in the php code, then
it's comment. If it is located in the html code like after //?> then it is php start delimiter.
Comment 3 Victoria Zhukovskaya 2008-04-14 10:18:49 UTC
another sample

        <?php
        $s="d";
        //<?php
        //?>
        
?>

result:
 first tag of php end  is commented but  highlighted as not commented
 second  tag of php end not highlighted  at all becouse first tag s not commented
Comment 4 Petr Pisl 2008-04-14 12:33:23 UTC
Please, read the specification. The first tag is not commented, because php end tag even in the comment is threated as
end php tag. 

<?php    -> open php tag
$s="d";  -> a php code
//<?php  -> php comment containing open php tag, which is comment
//?>     -> php comment containing close php tag, but the close php tag is not treated as comment 
?>       -> html text, because the pho block is closed by previous php close tag

One not from the link, which I add in my previous comment:
"//?> is not treated as commented text, this is a result of having to handle code on one line such as <?php echo
'something'; //comment ?>"
Comment 5 Victoria Zhukovskaya 2008-04-14 15:55:20 UTC
Ok I read manual. 
Zend has the same behaviour.

Thank You.
I had some misunderstanding in the question.