You're not trying to use a return value from your query method in that code. Notice the line containing the call to query doesn't contain a $something = in front of it.
You're DB::getInstance() method does return a value, which gets assigned to $user in that code. In the single-line version of the code, the value returned by DB::getInstance() is not captured, just used temporarily for the call to query. If you wanted a multi-line equivalent of your single line version it would be:
$tmp = DB::GetInstance();
$user = $tmp->query('...');
if($user) {
echo "success -> ";
} else {
echo "fail -> ";
}