|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36513 comment will be outputed in last line
Submitted: 2006-02-24 14:19 UTC Modified: 2006-04-13 13:52 UTC
Avg. Score:3.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2006-02-24 (snap) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2006-02-24 14:19 UTC]
If i have a php file with no ending ?> no newline at the end and the last line is a comment like this //} the comment "//}" will be printed to the output.

this happens just with
<? //}
no chars behind } and no newline

this bug occurs with php cli too.

php -r '//}'
outputs //}

Reproduce code:

Expected result:
empty output

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-24 15:49 UTC] mv-php at binarysec dot com
A patch can be found at 
 [2006-02-24 22:10 UTC]
I applied the patch and the bug is gone :)
 [2006-04-11 11:40 UTC]
Does not happen with PHP 4, does happen with PHP 5 and 6..
 [2006-04-12 11:07 UTC]
Just for the record: PHP4 behaves in the very same way.
 [2006-04-13 13:52 UTC]
Fixed in CVS HEAD, PHP_5_1 and PHP_4_4.

Comment '//<<EOF>>' is still lost for highlighter and tokenizer.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 12:01:34 2019 UTC