|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41867 getName is broken
Submitted: 2007-07-01 22:37 UTC Modified: 2007-07-02 11:38 UTC
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: moshe at varien dot com Assigned:
Status: Closed Package: SimpleXML related
PHP Version: 5.2.3 OS: Linux
Private report: No CVE-ID: None
 [2007-07-01 22:37 UTC] moshe at varien dot com
getName() returns name of the parent node instead of supplied one

Reproduce code:
$a = new SimplexmlElement("<a><b><c/></b></a>"); 
echo $a->b->c->getName();

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-01 23:10 UTC] moshe at varien dot com
Found a workaround:

$a = new SimplexmlElement("<a><b><c/></b></a>"); 
echo $a->b->c->c->getName();

 [2007-07-02 11:38 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jul 05 07:05:46 2022 UTC