This is because array()==NULL. It does not check the object type in this case.
gettype(null) returns null, whereas
gettype(array()) returns array. Hope you got the difference.
Probably what you need is
if ($json_decoded === null) {
echo "NULL";
} else
{
echo "NOT NULL";
}