private function equalityFunction()
    {
        return function ($a, $b) {
            if (is_object($a)) {
                $a = \serialize($a);
                $b = \serialize($b);
            }

            return ($a === $b ? 0 : ($a < $b ? -1 : 1));
        };
    }