Bug #53429 [Opn]: comparing the integer 0 "Zero" with any other string always returns true

From: Date: Tue, 30 Nov 2010 17:32:27 +0000
Subject: Bug #53429 [Opn]: comparing the integer 0 "Zero" with any other string always returns true
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156593@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53429&edit=1 ID: 53429 User updated by: claudsan at gmail dot com Reported by: claudsan at gmail dot com -Summary: comparing the integer 0 "Zero" with any other string always returns null +Summary: comparing the integer 0 "Zero" with any other string always returns true Status: Open Type: Bug Package: *General Issues Operating System: Windows 7 PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: comparing the integer 0 "Zero" with any other string always returns true Previous Comments: ------------------------------------------------------------------------ [2010-11-30 18:30:18] claudsan at gmail dot com Description: ------------ comparing the integer 0 "Zero" with any other string always returns null Test script: --------------- $x =(int) 0; if($x == 'foo') echo "Zero is foo"; //or var_dump($x == 'foo'); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53429&edit=1

« previous php.bugs (#156593) next »