RE: This is happening why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux