note 55343 deleted from function.is-null by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 12:17:45 +0000 |
| Subject: | note 55343 deleted from function.is-null by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197152@lists.php.net to get a copy of this message | ||
Note Submitter: MARSIK
----
I've tested different values in order to compare 'em with NULL with the help of different
operators...
<?php
$arr=array(0, 0.0, '0', '0.0', '',FALSE,'false',NULL,
'NULL');
for ($i=0; $i<count($arr); $i++)
$arr[$i]=array(
$arr[$i],
((integer)($arr[$i]==NULL))
.((integer)($arr[$i]===NULL))
.((integer)is_null($arr[$i]))
);
var_dump($arr);
?>
it gave the following results:
0 : ==NULL
0.0 : ==NULL
'0' : nothing worked =)
'0.0' : nothing...
'' : ==NULL
FALSE : ==NULL
'false' : nothing
NULL : ==NULL, ===NULL, is_null()
'NULL' : nothing
enjoy =)