RE: [PHP] This is happening why?

From: Date: Mon, 06 Jun 2005 19:03:34 +0000
Subject: RE: [PHP] This is happening why?
Groups: php.general 
Request: Send a blank email to php-general+get-216511@lists.php.net to get a copy of this message
[snip] <? if( 0 == 'NULL' ) { echo "'NULL' == 0<br>"; } else { echo "'NULL' != 0<br>"; } ?> [/snip] Interesting, to be sure. I even flipped the test.... if('NULL' == 0) Of course, once I made 0 a string '0' the test evaluated FALSE. So 0 (integer) is TRUE and 'NULL' is TRUE, which means that you asked if(TRUE == TRUE), which is, of course, TRUE.

« previous php.general (#216511) next »