note 102524 deleted from language.types.null by danbrown

[email protected] Sat, 19 Feb 2011 07:36:31 -0800
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: contact at mullanaphy dot com 

----

In reply to poutri_j's post (albeit old) about an empty array() == NULL.

It's not that an empty array is considered null, its that both are considered FALSE in a comparison. So:

<?php
$array = array();
if($array==NULL) echo '$array == NULL'; # Echos
if($array===NULL) echo '$array === NULL'; # Doesn't echo.
?>

This is as expected and something that all newcomers should pick up on. Link to PHP's great reference on comparisons: http://php.net/manual/de/types.comparisons.php