empty () only works with variables, as this function also checks if a function is defined.
To make the code below the executable
if(!empty(a_function($var)))
do_stuff();
you need to save the result from a_function () to a temporary variable
$temp = a_function($var);
if(!empty($temp))
do_stuff();
source
share