As of PHP 5, objects with no properties are no longer considered empty. Therefore is you use empty() to test if an object is empty will always return true.
The easiest way to check for an empty object is to cast it to an array:
$objAsArray = (array)$object; if ( empty( $objAsArray ) {...}
Incidently there are a lot of posts online about how to convert an array to an object. The quickest way is to cast it as an object:
$rs = array(); return (object)$rs;