replace !empty call by simple if check

-it is shorter
-it works for all PHP versions