public function __construct(callable $comparer = null) { if ($comparer === null) { $comparer = function ($x, $y) { return $x > $y ? 1 : ($x < $y ? -1 : 0); }; } $this->comparer = $comparer; }