|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67545 htmlentities is not working
Submitted: 2014-06-30 11:25 UTC Modified: 2014-06-30 14:44 UTC
From: benedict dot poppe at neuberger dot net Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.5.14 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: benedict dot poppe at neuberger dot net
New email:
PHP Version: OS:


 [2014-06-30 11:25 UTC] benedict dot poppe at neuberger dot net
I have an webspace account with PHP 5.5 on

If i use the function "htmlentities", define a variable with htmlcode and commit the var as function- parameter, nothing happens.

I start error_reporting, but no errors are displayed. 

If i use the htmlentities function twice on an var, i see the correct output. 
I tested it with different character sets and flags.

See my testscript.

The problem appears on an local linux ubuntu server with PHP Version 5.3.2-1ubuntu4.25

and on my webspace account with PHP Version 5.5

Test script:
This Example -->> doesn't <<-- work on my system: 

$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str);

This Example -->> work <<-- on my system: 

$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities(htmlentities($str));


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-30 14:44 UTC]
-Status: Open +Status: Not a bug
 [2014-06-30 14:44 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

User your browser's "view source" feature (Ctrl+U) or a command line PHP to see what happens.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC