|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-11-04 09:13 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2020-11-04 09:13 UTC] requinix@php.net
[2020-11-04 10:14 UTC] jab_creations at yahoo dot com
[2020-11-04 10:55 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 20:00:01 2025 UTC |
Description: ------------ When a string contains a closing comment */ PHP fails to interpret it as a string. My best guess is that the initial parser is looking for comments BEFORE interpreting the structure. Test script: --------------- <?php function xml_cleaner($xml) { /* //Remove CSS Comments (they conflict with checking for proper element nesting): $xml = str_replace('/*', '__com0', $xml); $xml = str_replace('*/', 'com1__', $xml);//Bug here. $xml = preg_replace('/__com0.*?com1__/s', '', $xml); */ } ?> Expected result: ---------------- The parser should ignore comments contained within strings. Actual result: -------------- Parse error: syntax error, unexpected 'com1__' (T_STRING) in bug.php on line 7