//The usual way we do check-abort procedure: if (!$order) { abort(404); } //Now you can do it in one line: abort_if(!$order, 404);