public static function is_empty($obj = null)
{
if (is_null($obj)) {
return true;
} elseif (is_array($obj)) {
return empty($obj);
} elseif (is_string($obj)) {
return strlen($obj) == 0;
} elseif ($obj instanceof \Countable) {
return count($obj) ? false : true;
} elseif ($obj instanceof \Traversable) {
return iterator_count($obj);
} else {
return false;
}
}