Bug #52463 [Opn->Dup]: SimpleXml ignores attributes

From: Date: Tue, 27 Jul 2010 21:10:27 +0000
Subject: Bug #52463 [Opn->Dup]: SimpleXml ignores attributes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-152857@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52463&edit=1 ID: 52463 Updated by: rasmus@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

« previous php.bugs (#152857) next »