(PHP 5 >= 5.4)
is_var_empty — Determine whether a variable or object is empty.
boolean is_var_empty( mixed $var )Alternative to empty() which will resolve stringable and arrayable objects.
var— The value to be checked.
Returns FALSE if var exists and has a non-empty value. Otherwise returns TRUE.
$ composer require mcaskill/php-is-var-empty
Why are you not using composer? Download Function.Is-Var-Empty.php from the gist and save the file into your project path somewhere.