php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46398 highlight_string() removes backslashes
Submitted: 2008-10-27 00:32 UTC Modified: 2008-10-27 07:08 UTC
From: fromphp dot nethash69 at vano dot org Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.6 OS: Windows XP Pro
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fromphp dot nethash69 at vano dot org
New email:
PHP Version: OS:

 

 [2008-10-27 00:32 UTC] fromphp dot nethash69 at vano dot org
Description:
------------
function highlight_string() removes backslashes

Reproduce code:
---------------
<?php
$text = '<?php
$blah = 1;
\\this is a comment line with two backslashes at the beginning and one at the end:\
$blah = 2;
?>';
highlight_string($text);
?>

Expected result:
----------------
Expected output in the browser:

<?php
$blah = 1;
\\this is a comment line with two backslashes at the beginning and one at the end:\
$blah = 2;
?>

Actual result:
--------------
Actual output in the browser:

<?php 
$blah = 1; 
this is a comment line with two backslashes at the beginning and one at the end: 
$blah = 2; 
?> 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-27 07:08 UTC] scottmac@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

// is a comment not \\ which is an escape character.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 21:00:01 2025 UTC