|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-23 04:12 UTC] derick@php.net
[2003-12-25 04:39 UTC] vrana@php.net
[2003-12-25 04:47 UTC] derick@php.net
[2003-12-25 04:55 UTC] vrana@php.net
[2003-12-25 13:54 UTC] iliaa@php.net
[2003-12-26 05:04 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
Description: ------------ There are two issues with highlight_string, highlight_file and `php -s`: 1. Some characters (like []{}) are highlighted in non-constant strings (i.e. double quote strings with variables) as a keyword even on places where they don't have any special purpose. 2. Some characters ([]{} and backslash sequences) are highlighted in non-constant strings and aren't highlighted in constant strings. It should be consistent. Suggested solution: Don't highlight anything as a keyword both in constant and non-constant strings. I've already sent a patch for this to internals@lists.php.net. Reproduce code: --------------- <?php highlight_string('<?php "foo[] $a \n"; ?>'); ?> Expected result: ---------------- <code><font color="#000000"> <font color="#0000BB"><?php </font><font color="#DD0000">"foo[] $a \n"</font><font color="#007700">; </font><font color="#0000BB">?></font> </font> </code> Actual result: -------------- <code><font color="#000000"> <font color="#0000BB"><?php </font><font color="#DD0000">"foo</font><font color="#007700">[]</font><font color="#DD0000"> $a </font><font color="#007700">\n</font><font color="#DD0000">"</font><font color="#007700">; </font><font color="#0000BB">?></font> </font> </code>