I'd suggest to use empty() for checks like this