php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34127 Problems in SimpleXML object
Submitted: 2005-08-14 14:30 UTC Modified: 2005-08-14 15:09 UTC
From: alesegala at users dot sourceforge dot net Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.* OS: *
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alesegala at users dot sourceforge dot net
New email:
PHP Version: OS:

 

 [2005-08-14 14:30 UTC] alesegala at users dot sourceforge dot net
Description:
------------
I parsed an XML file with SimpleXML (I used simplexml_load_file()) and I stored it into $xml.
You can view the object (printed using var_dump()) here: http://phpfi.com/74016
I needed to copy the array "album" (only that array) into $album, so I did $album = $xml->album; .
At this point $album didn't contain all the array, but only the first element:
object(SimpleXMLElement)#3 (4) {
  ["id"]=>
  string(1) "2"
  ["parent_id"]=>
  string(1) "3"
  ["name"]=>
  string(13) "Test subalbum"
  ["description"]=>
  object(SimpleXMLElement)#5 (0) {
  }
}

I'm using Windows XP Pro SP2, Apache 2.0.53, PHP 5.0.4, SimpleXML 1.139.2.4 (I took the dll from the archive pecl-5.0.4).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-14 15:09 UTC] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

SimpleXMLObjects are iterators not legacy php arrays.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 08 06:05:52 2022 UTC