ID: 50330 Updated by: phi...@php.net Reported By: wdolek at gmail dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: GNU/Linux PHP Version: 5.2.11 New Comment:
This will never change. - http://www.php.net/manual/en/types.comparisons.php It is what it is. Previous Comments: ------------------------------------------------------------------------ [2009-11-30 10:23:04] wdolek at gmail dot com Description: ------------ when comparing empty string, empty array, FALSE, integer 0 with NULL, comparison always returns TRUE. but imho empty string, FALSE or 0 are still any values, instead of NULL is "no" value. of course, i can use === but documentation says "equals" - isn't is little bit confusing to check also type, when NULL has no type? in whatever programming lanugage, NULL is NULL and not anything else, don't know, why PHP behaves differently Reproduce code: --------------- // should be array(), 0, FALSE etc. instead of '' if ('' == NULL) { echo 'hey dummy, empty string should not be NULL!'; } else { echo 'yeah, empty string is not NULL at all!'; } Expected result: ---------------- yeah, empty string is not NULL at all! Actual result: -------------- hey dummy, empty string should not be NULL! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50330&edit=1