|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42767 highlight_string() 'eats' the unclosed comment
Submitted: 2007-09-26 12:20 UTC Modified: 2009-05-09 00:46 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: g0rn at mail dot ru Assigned: iliaa
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.4 OS: Linux
Private report: No CVE-ID:
 [2007-09-26 12:20 UTC] g0rn at mail dot ru
When I use highlight_string() on unclosed /* comment it doesn't returns anything, after this comment.

Reproduce code:
highlight_string('<?php /*some comment..');
some code
some code
some code
/* some comment..');

Expected result:
In first example it should return:
<?php /*some comment..
In second:
some code
some code
some code
/* some comment..

Actual result:
In first example it returns:
In second it returns:
some code
some code
some code


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-26 15:46 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 06:01:48 2015 UTC