PHP 4.0 Bug #6992 Updated: string "NULL" equals 0

From: Date: Tue, 03 Oct 2000 12:43:14 +0000
Subject: PHP 4.0 Bug #6992 Updated: string "NULL" equals 0
Groups: php.dev 
Request: Send a blank email to php-dev+get-34125@lists.php.net to get a copy of this message
ID: 6992 Updated by: waldschrott Reported By: david@php.net Status: Analyzed Bug Type: Documentation problem Assigned To: Comments: just saw this issue is already covered by documenation, but hairy things like "AZ"<="AAZ" not Previous Comments: --------------------------------------------------------------------------- [2000-10-03 08:39:17] waldschrott@php.net hehe, you´ve been fooled by auto-conversion... :) <?php echo "CONERTMETOZERO"==0; ?> See? Perhaps we need some chapter about auto-conversion? Telling which rules apply comparing 'AZ' against 'A' or 'AAT' or 0 or whatever --------------------------------------------------------------------------- [2000-10-03 08:01:12] david@php.net The text string "NULL" compares equal to 0. This is rubbish. The string is not empty. NULL may compare equal to 0. The string containing NULL should not. [david@serena php4]$ ./php <? if ("NULL" == 0) echo "This is not good."; ?> X-Powered-By: PHP/4.0.3RC1 Content-type: text/html This is not good. ./configure --with-config-file-path=pwd --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6992

« previous php.dev (#34125) next »