fix empty() bug with PHP < 5.5