RE: PHP 5.2 array() == null

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

 



> -----Original Message-----
> From: dominic.letz@xxxxxxxxx [mailto:dominic.letz@xxxxxxxxx]
> Sent: 15 May 2007 16:48
> To: php-general@xxxxxxxxxxxxx
> Subject:  PHP 5.2 array() == null
>
>
> Hi people
>
> i was just curios to ask whether
>
> array() == null should always return true. and then why
>
> i'm testing this with php 5.2.2
>
> greetings
>
> dominic letz
>

According to Table Q.2 at
http://www.php.net/manual/en/types.comparisons.php, array() == NULL will
always return TRUE.

Remember == is a loose comparison. I think this is a result of the
following:

      array() == FALSE  is TRUE (because it's empty?)
        FALSE == NULL   is TRUE
thus  array() == NULL   is TRUE

Edward

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