$arr = (array)$obj; if (!$arr) { // do stuff }
$x = new stdClass();
if($users->count()==0){ $result->errer = "not exist"; }
if( $obj !== null ) { // DO YOUR WORK }