Why not just if (!$target) ?