From: liatb at marvell dot com Operating system: windows PHP version: 5.2.0 PHP Bug Type: SimpleXML related Bug description: simpleXMLElement == behaviur changed
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 -- Edit bug report at http://bugs.php.net/?id=39866&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39866&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39866&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39866&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39866&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39866&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39866&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39866&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39866&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39866&r=support Expected behavior: http://bugs.php.net/fix.php?id=39866&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39866&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39866&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39866&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39866&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39866&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39866&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39866&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39866&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39866&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39866&r=mysqlcfg