/** * Compare to mark. * $a op $b : return -1 if $a < $b, 0 if $a == $b, and 1 if $a > $b. We * compare the difference between $start and $stop, i.e. we call the diff() * method. * * @param \Hoa\Bench\Mark $mark The mark to compare to. * @return int */ public function compareTo(Mark $mark) { $a = $this->diff(); $b = $mark->diff(); if ($a < $b) { return -1; } elseif ($a == $b) { return 0; } else { return 1; } }