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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC