From: lists at cyberlot dot net
Operating system: Fedore Core 3
PHP version: 5.1.0RC4
PHP Bug Type: SimpleXML related
Bug description: XML object fails FALSE test
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 bug report at http://bugs.php.net/?id=35028&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35028&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35028&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35028&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35028&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35028&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35028&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35028&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35028&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35028&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35028&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35028&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35028&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35028&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35028&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35028&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35028&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35028&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35028&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35028&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35028&r=mysqlcfg