php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60069 highlight_file/string outputs extra "1"
Submitted: 2011-10-16 16:11 UTC Modified: 2011-10-16 16:19 UTC
From: pajoye@php.net Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3SVN-2011-10-16 (SVN) OS:
Private report: No CVE-ID: None
 [2011-10-16 16:11 UTC] pajoye@php.net
Description:
------------
An extra char is written using highlight_file.

Test script:
---------------
<?php echo highlight_file(__FILE__); ?>

or

<?php echo highlight_string(file_get_contents(__FILE__)); ?>

Expected result:
----------------
<code><span style="color: #000000">
<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: 
#0000BB">highlight_file</span><span style="color: #007700">(</span><span<br />
</span>: #0000BB">__FILE__</span><span style="color: #007700">);
</span>
</code>

Actual result:
--------------
<code><span style="color: #000000">
<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: 
#0000BB">highlight_file</span><span style="color: #007700">(</span><span<br />
</span>: #0000BB">__FILE__</span><span style="color: #007700">);
</span>
</code>1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-16 16:19 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-10-16 16:19 UTC] pajoye@php.net
forgot that highlight_* outputs the string directly, so annoying but documented > 
bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 19:01:30 2024 UTC