Edit report at http://bugs.php.net/bug.php?id=53487&edit=1
ID: 53487 Comment by: kherrera at codealchemy dot com Reported by: kherrera at codealchemy dot com Summary: (integer) 0 == '_' Status: Bogus Type: Bug Package: Scripting Engine problem Operating System: Windows XP SP3 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: That's what I'm doing now, but why is this being flagged as bogus? Zero is not equal to an underscore, typed or not. Previous Comments: ------------------------------------------------------------------------ [2010-12-06 18:07:50] [email protected] use ===. and try echo (int) '_'; ------------------------------------------------------------------------ [2010-12-06 17:45:20] kherrera at codealchemy dot com Description: ------------ When testing the expression of integer "0" (zero) equals "_" (underscore), the result of the expression is true, when it should be false. I could not select the proper PHP version number because it was not listed: C:>php -v PHP 5.3.2 (cli) (built: Mar 3 2010 20:36:54) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans Test script: --------------- <?php $index = 0; if ( $index == '_' ) echo "Bug found.\n"; else echo "No bug found.\n"; Expected result: ---------------- No bug found. Actual result: -------------- Bug found. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53487&edit=1
