|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-08 21:40 UTC] jani@php.net
-Package: Feature/Change Request
+Package: Scripting Engine problem
[2012-06-05 23:09 UTC] nikic@php.net
[2012-06-05 23:09 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 06:00:02 2025 UTC |
Description: ------------ Running highlight_string() on a string with PHP code and an unterminated comment, produces output that doesn't have the comment. Additionally, when the string is dynamically generated from the file-content of a PHP file using file_get_contents(), a PHP warning about unterminated comments is present in the output. Reproduce code: --------------- echo highlight_string('<?php echo "hello"; /*comment*/ /*unterminated comment', true); Expected result: ---------------- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"hello"</span><span style="color: #007700">; </span><span style="color: #FF8000">/*comment*/ </span><span style="color: #FF8000">/*unterminated comment;</span> </span> </code> Actual result: -------------- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"hello"</span><span style="color: #007700">; </span><span style="color: #FF8000">/*comment*/ </span> </span> </code>