ID: 51154
User updated by: mr at inpay dot com
Reported By: mr at inpay dot com
Status: Open
Bug Type: SimpleXML related
Operating System: Windows 7 Professional
PHP Version: 5.3.1
New Comment:
Oops, but accident i switched the "Expected result" and "Actual
result"
Expected result should be SimpleXMLElement Object ( [http_code] => 200
)
Actual result should be SimpleXMLElement Object ( [http-code] => 200 )
Sorry for the inconvinience.
Previous Comments:
------------------------------------------------------------------------
[2010-02-26 08:38:41] mr at inpay dot com
Description:
------------
Having a XML string, where one or more of the nodenames contains a -
(dash) it is impossible to return that value, as dash is not allowed in
attributes on an object. Consider replacing all dash'es with
underscores.
Reproduce code:
---------------
<?php
$xml_string = "<response><http-code>200</http-code></response>";
$xml = new SimpleXMLElement($xml_string);
print_r($xml);
?>
Expected result:
----------------
SimpleXMLElement Object ( [http-code] => 200 )
Actual result:
--------------
SimpleXMLElement Object ( [http_code] => 200 )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=51154&edit=1