#29911 [Opn->Bgs]: DOMDocuments are always equal.

From: Date: Tue, 31 Aug 2004 11:40:44 +0000
Subject: #29911 [Opn->Bgs]: DOMDocuments are always equal.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65506@lists.php.net to get a copy of this message
ID: 29911 Updated by: chregu@php.net Reported By: wb at pro-net dot co dot uk -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: FreeBSD 5.2.1 PHP Version: 5.0.1 New Comment: That's (with every object in PHP) expected behaviour. Although $dom->saveXML() == $dom2->saveXML() should work Previous Comments: ------------------------------------------------------------------------ [2004-08-31 12:59:55] wb at pro-net dot co dot uk Description: ------------ Different DOMDocuments are always equal even if the 'XML' is different. Reproduce code: --------------- <?php $dom1 = new DOMDocument(); $dom1->loadXML("<root><node/></root>"); $dom2 = new DOMDocument(); $dom2->loadXML("<root><node/></root>"); $dom3 = new DOMDocument(); $dom3->loadXML("<root><node type=\"blah\"/></root>"); if($dom1 == $dom2){ print("dom1 == dom2\n"); }else{ print("dom1 != dom2\n"); } if($dom1 == $dom3){ print("dom1 == dom3\n"); }else{ print("dom1 != dom3\n"); } ?> Expected result: ---------------- dom1 == dom2 dom1 != dom3 Actual result: -------------- dom1 == dom2 dom1 == dom3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29911&edit=1

« previous php.bugs (#65506) next »