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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: moshe at varien dot com
New email:
PHP Version: OS:

 

 [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: Fri Nov 22 18:01:31 2024 UTC