RE: [PHP] PHP 5.2 array() == null

From: Date: Tue, 15 May 2007 16:27:40 +0000
Subject: RE: [PHP] PHP 5.2 array() == null
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-254981@lists.php.net to get a copy of this message
> -----Original Message----- > From: dominic.letz@berlin.de [mailto:dominic.letz@berlin.de] > Sent: 15 May 2007 16:48 > To: php-general@lists.php.net > Subject: [PHP] 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

« previous php.general (#254981) next »