private static function find_entry(&$in, $id, $offset) { fseek($in, $offset); do { $previousEntry = $entry; $entry = MMDBParser::read_entry($in); if ($previousEntry != null && $entry['id'] < $previousEntry['id']) { return null; } } while ($id != $entry['id']); return $entry; }