php.net |  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
Votes:3
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
Description:
------------
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:
----------------
"c"

Actual result:
--------------
"b"

Patches

Pull Requests

History

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();

Eeww...
 [2007-07-02 11:38 UTC] rrichards@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC