As the PHP manual says:

empty — Determine whether a variable is empty

In your case, trim is a function call, not a variable.

If you really want to do your if statement inline, you can use something like:

if (!empty($var=trim($_POST['username'])) && !empty($var=trim($_POST['email'])))

But a better implementation should be:

$username = array_key_exists('username', $_POST) ? trim($_POST['username']) : null;
$email = array_key_exists('email', $_POST) ? trim($_POST['email']) : null;

if (!empty($username) && !empty($email))