PHP STARIC STACT Back Vs Cierre

$myUniqueArray = unique($arrayToFilter,
    function (ExamQuestion $examQuestion) {
        return $examQuestion->getId();
    }
);