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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 - 29 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC