php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50880 SimpleXML parser error in example
Submitted: 2010-01-29 11:47 UTC Modified: 2010-01-29 13:51 UTC
From: kotnick at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Ubuntu 9.10
Private report: No CVE-ID: None
 [2010-01-29 11:47 UTC] kotnick at gmail dot com
Description:
------------
Example causes SimpleXML error on PHP 5.2.10.

Reproduce code:
---------------
---
From manual page: simplexmlelement.attributes#Examples
---


Expected result:
----------------
name="one"
game="lonely"


Actual result:
--------------
Warning: simplexml_load_string(): Entity: line 1: parser error : Specification mandate value for attribute b in /home/kotnik/xmltest.php on line 8

Call Stack:
    0.0003     107144   1. {main}() /home/kotnik/xmltest.php:0
    0.0003     107520   2. simplexml_load_string() /home/kotnik/xmltest.php:8


Warning: simplexml_load_string(): <a xmlns:b> in /home/kotnik/xmltest.php on line 8

Call Stack:
    0.0003     107144   1. {main}() /home/kotnik/xmltest.php:0
    0.0003     107520   2. simplexml_load_string() /home/kotnik/xmltest.php:8


Warning: simplexml_load_string():           ^ in /home/kotnik/xmltest.php on line 8

Call Stack:
    0.0003     107144   1. {main}() /home/kotnik/xmltest.php:0
    0.0003     107520   2. simplexml_load_string() /home/kotnik/xmltest.php:8


Fatal error: Call to a member function attributes() on a non-object in /home/kotnik/xmltest.php on line 9

Call Stack:
    0.0003     107144   1. {main}() /home/kotnik/xmltest.php:0


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-29 13:17 UTC] svn@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=294200
Log: corrected broken example, fixes #50880
 [2010-01-29 13:18 UTC] salathe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

The broken namespace declaration has been removed from the example code.
 [2010-01-29 13:51 UTC] kotnick at gmail dot com
Thank you for fixing it!
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 08:00:01 2026 UTC