Edit report at http://bugs.php.net/bug.php?id=52463&edit=1

 ID:                 52463
 Updated by:         ras...@php.net
 Reported by:        circus2 at freenet dot de
 Summary:            SimpleXml ignores attributes
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            SimpleXML related
 Operating System:   Win7 Home Premium GER
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

This is a known cosmetic issue in var_dump().  If you actually iterate
through the 

object it works fine.


Previous Comments:
------------------------------------------------------------------------
[2010-07-27 21:26:21] circus2 at freenet dot de

Description:
------------
I have a short xml and the attributes for the second node are not
available.





Test script:
---------------
$xml = '

    <xml>

        <value type="string" key="name"></value>

        <value type="string" key="name">myValue</value>

    </xml>

';



var_dump(simplexml_load_string($xml));

Expected result:
----------------
Array

(

    [value] => Array

        (

            [0] => Array

                (

                    [...@attributes] => Array

                        (

                            [type] => string

                            [key] => name

                        )



                )



            [1] => Array

                (

                    [...@attributes] => Array

                        (

                            [type] => string

                            [key] => name

                        )

                    [0] => myValue



                )

        )



)



Or something similar.



Actual result:
--------------
Array

(

    [value] => Array

        (

            [0] => Array

                (

                    [...@attributes] => Array

                        (

                            [type] => string

                            [key] => name

                        )



                )



            [1] => myValue

        )



)




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52463&edit=1

Reply via email to