/** * Returns the gap between this lap and the given lap * * @return float|null */ public function getGap(Lap $lap) { // Given lap or this lap has no time if ($lap->getTime() === null or $this->getTime() === null) { return null; } // Return difference and round to 4 to fix floats return round($lap->getTime() - $this->getTime(), 4); }