#31045 [NEW]: Testing return value of simplexml_load_string

From: Date: Thu, 09 Dec 2004 22:24:00 +0000
Subject: #31045 [NEW]: Testing return value of simplexml_load_string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-69987@lists.php.net to get a copy of this message
From:             rbro at hotmail dot com
Operating system: Linux
PHP version:      5CVS-2004-12-09 (dev)
PHP Bug Type:     SimpleXML related
Bug description:  Testing return value of simplexml_load_string

Description:
------------
The manual states that simplexml_load_string (and simplexml_load_file)
returns false on any errors.  In the following example, I am loading a
valid xml stream, but the simplexml object returned seems to equal false
when it shouldn't.

Reproduce code:
---------------
<?php
$doc = simplexml_load_string('<xml></xml>');

if ($doc == false)
{
	echo 'equals false';
}
else
{
	echo 'does not equal false';
}
?>


Expected result:
----------------
does not equal false

Actual result:
--------------
equals false

-- 
Edit bug report at http://bugs.php.net/?id=31045&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31045&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31045&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31045&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31045&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31045&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31045&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31045&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31045&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31045&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31045&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=31045&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=31045&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31045&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31045&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31045&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31045&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31045&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31045&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31045&r=mysqlcfg


Thread (9 messages)

« previous php.bugs (#69987) next »