|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27541 SimpleXML fails to load an xml file which contains html entities
Submitted: 2004-03-09 13:00 UTC Modified: 2004-03-09 18:25 UTC
From: silver_dragoon77 at hotmail dot com Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.0.0b4 (beta4) OS: WinXP
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: silver_dragoon77 at hotmail dot com
New email:
PHP Version: OS:


 [2004-03-09 13:00 UTC] silver_dragoon77 at hotmail dot com
The example string given at the php simple xml manual page contains actór (spanish stress on the "o"). simplexml_load_string or even simplexml_load_file both fail. If I remove the ó it works fine.

Reproduce code:
$xmlstr = <<<XML
<?xml version='1.0' standalone='yes'?>
  <title>PHP: Behind the Parser</title>
    <name>Ms. Coder</name>
    <actor>Onlivia Actora</actor>
    <name>Mr. Coder</name>
    <actor>El Actor</actor>
   So, this language. It's like, a programming language. Or is it a
   scripting language? All is revealed in this thrilling horror spoof
   of a documentary.
  <rating type="thumbs">7</rating>
  <rating type="stars">5</rating>

$xml = simplexml_load_string($xmlstr);

Expected result:
var_dump should return a simplexml object

Actual result:
$xml is bool(false)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-09 13:25 UTC] silver_dragoon77 at hotmail dot com
Ooops sorry I didn't realize that my file wasn't unicode encoded !
 [2004-03-09 18:25 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

XML parsers cannot understand html entities, you must use 
&#[number]; to represent 'special' characters. 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 21:01:28 2024 UTC