#44990 [Bgs]: array('word')==array(0) -- true

From: Date: Wed, 14 May 2008 02:58:01 +0000
Subject: #44990 [Bgs]: array('word')==array(0) -- true
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124972@lists.php.net to get a copy of this message
ID: 44990 User updated by: design at apostolstudio dot com Reported By: design at apostolstudio dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows XP PHP Version: 5.2.6 New Comment: Thanks for explanations. Previous Comments: ------------------------------------------------------------------------ [2008-05-14 02:39:53] cellog@php.net use === 'word' is converted to an integer for the comparison, and thus 0 == 0. try this code: if(array('word')===array(0)) echo "ERROR"; ------------------------------------------------------------------------ [2008-05-14 02:27:10] design at apostolstudio dot com Description: ------------ array('word')==array(0) -- return true Reproduce code: --------------- if(array('word')==array(0)) echo "ERROR"; Actual result: -------------- ERROR ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44990&edit=1

« previous php.bugs (#124972) next »