#27413 [Opn->Bgs]: SimpleXML text comparison

From: Date: Fri, 27 Feb 2004 07:16:45 +0000
Subject: #27413 [Opn->Bgs]: SimpleXML text comparison
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55636@lists.php.net to get a copy of this message
ID: 27413 Updated by: sniper@php.net Reported By: rbro at hotmail dot com -Status: Open +Status: Bogus Bug Type: XML related Operating System: Linux PHP Version: 5CVS-2004-02-26 (dev) New Comment: Try doing a 'var_dump($sxe['a']);'...comparing string to an object can't really be true in any case? Previous Comments: ------------------------------------------------------------------------ [2004-02-27 00:11:03] rbro at hotmail dot com Description: ------------ Doing the following SimpleXML text comparison does not give the expected results. Reproduce code: --------------- <?php $sxe = simplexml_load_string('<root a="123" />'); echo $sxe['a']."\n"; if ($sxe['a'] == '123') { echo 'They are equal.'."\n"; } else { echo 'They are not equal.'."\n"; } ?> Expected result: ---------------- 123 They are equal. Actual result: -------------- 123 They are not equal. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27413&edit=1

« previous php.bugs (#55636) next »