PHP 4.0 Bug #4614: Empty strings are also considered as NULL

From: Date: Fri, 26 May 2000 14:09:20 +0000
Subject: PHP 4.0 Bug #4614: Empty strings are also considered as NULL
Groups: php.dev 
Request: Send a blank email to php-dev+get-19505@lists.php.net to get a copy of this message
From: stephane.legrand@bigfoot.com Operating system: FreeBSD PHP version: 4.0.0 Release PHP Bug Type: Other Bug description: Empty strings are also considered as NULL <? $test = ""; if ($test == NULL) { print("test is NULL <br>\n"); } ?> With PHP4, this code displays "test is NULL". With PHP3, this code displays nothing. - it seems to me that PHP3 has a far more logical behaviour. - i think it can be a big incompatibility problem between PHP3 and PHP4. So, is it a bug or a feature ? And is there a way to force PHP4 to act like PHP3 in this particular case ? Thank you. Stephane Legrand.

« previous php.dev (#19505) next »