#34127 [Opn->Bgs]: Problems in SimpleXML object
| From: | helly@php.net | Date: | Sun, 14 Aug 2005 13:09:32 +0000 |
| Subject: | #34127 [Opn->Bgs]: Problems in SimpleXML object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83556@lists.php.net to get a copy of this message | ||
ID: 34127
Updated by: helly@php.net
Reported By: alesegala at users dot sourceforge dot net
-Status: Open
+Status: Bogus
Bug Type: SimpleXML related
-Operating System: Windows XP Pro SP2
+Operating System: *
-PHP Version: 5.0.4
+PHP Version: 5.*
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2005-08-14 14:30:33] 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).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34127&edit=1