#35028 [Com]: XML object fails FALSE test

From: Date: Sun, 30 Oct 2005 18:29:45 +0000
Subject: #35028 [Com]: XML object fails FALSE test
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87230@lists.php.net to get a copy of this message
ID: 35028 Comment by: alex at whitewhale dot net Reported By: lists at cyberlot dot net Status: Open Bug Type: SimpleXML related Operating System: Fedore Core 3 PHP Version: 5.1.0RC4 New Comment: Note that if you change $string to: $string = str_replace('><','> <',"<doc><login>kkl</ login><password>klk</password></doc>"); It passes. Previous Comments: ------------------------------------------------------------------------ [2005-10-30 19:21:46] lists at cyberlot dot net Description: ------------ $xml object returns false, this worked in RC1 fails in RC3 and RC4 never tested RC2 xml string of <doc>test</doc> DOES pass test. Its only when you have subchildren children that the $xml object fails to pass. <doc><test>test</test></doc> fails <doc>test</doc> Passes. if(is_object($xml)) { works, and is prob the best method to use but one would expect $xml to be "true" Realize this might be considered a dupe of bug #31045 however bug #34199 suggests the same issue that states this is fixed. Reproduce code: --------------- <? $string = "<doc><login>kkl</login><password>klk</password></doc>"; $xml = simplexml_load_String($string); if($xml) { echo "Passed test\n"; } else { echo "Even though is object still failed false test\n"; } ?> Expected result: ---------------- Expect output of Passed test Actual result: -------------- output of Even though is object still failed false test ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35028&edit=1

« previous php.bugs (#87230) next »