#41756 [Opn->Csd]: It was bogus

From: Date: Thu, 21 Jun 2007 11:00:08 +0000
Subject: #41756 [Opn->Csd]: It was bogus
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113993@lists.php.net to get a copy of this message
ID: 41756 User updated by: vinod dot lakhanpal at gmail dot com -Summary: Comparison operator shows invalid result (with some characters ) Urgent !! Reported By: vinod dot lakhanpal at gmail dot com -Status: Open +Status: Closed Bug Type: Unknown/Other Function Operating System: linux PHP Version: 4.4.7 New Comment: Oops it was my fault . I was converting the & into & before comparing . Soory. Previous Comments: ------------------------------------------------------------------------ [2007-06-21 10:01:12] vinod dot lakhanpal at gmail dot com Description: ------------ Hi Just try this $tmp="flight&Hotel&Car"; if($tmp=="flight&Hotel&Car"){ echo "Hello vinod"; }else{ echo "Bye vinod"; } to your surprise it will display "Bye vinod" where as it should have displayed "Hello vinod". Its really astonishing that nobody pointed this error in php. Reproduce code: --------------- $tmp="flight&Hotel&Car"; if($tmp=="flight&Hotel&Car"){ echo "Hello vinod"; }else{ echo "Bye vinod"; } Expected result: ---------------- Hello vinod Actual result: -------------- Bye vinod ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41756&edit=1

« previous php.bugs (#113993) next »