|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-18 13:58 UTC] tony2001@php.net
[2006-12-18 21:50 UTC] liatb at marvell dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 19:00:01 2025 UTC |
Description: ------------ I upgraded my PHP version from 5.1.* to 5.2.0 XML string loaded into two different simpleXML objects. The result of comparing xml node attributes (without any specific cast) in version 5.2.0 is different then used to be in 5.0.3 and 5.1.5. I also checked the last snapshot for windows marked as "PHP Version 5.2.1RC2-dev" and got the same output as 5.2.0 Reproduce code: --------------- <?php $xmlStr = "<test id=\"5\"><name>hello</name></test>"; $xml_1 = simplexml_load_string($xmlStr); $xml_2 = simplexml_load_string($xmlStr); var_dump($xml_1); var_dump($xml_2); print("<br/>"); if($xml_1['id'] == $xml_2['id']) { print("equal ids"); } else { print("not equal ids"); } print("<br/>"); if($xml_1->name == $xml_2->name) { print("equal names"); } else { print("not equal names"); } ?> Expected result: ---------------- equal ids equal names Actual result: -------------- not equal ids not equal names