private function run($argv) { $ids = ZoneRulesProvider::getAvailableZoneIds(); $start = Instant::now(); foreach ($ids as $id) { TZDBZoneRulesProvider::getRules($id, false); } $end = Instant::now(); echo 'First run: ', ChronoUnit::MILLIS()->between($start, $end), "ms, count: ", count($ids), "\n"; }
function data_adjustInto() { return [[Instant::ofEpochSecond(10, 200), Instant::ofEpochSecond(20), Instant::ofEpochSecond(10, 200), null], [Instant::ofEpochSecond(10, -200), Instant::now(), Instant::ofEpochSecond(10, -200), null], [Instant::ofEpochSecond(-10), Instant::EPOCH(), Instant::ofEpochSecond(-10), null], [Instant::ofEpochSecond(10), Instant::MIN(), Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10), Instant::MAX(), Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10, 200), LocalDateTime::of(1970, 1, 1, 0, 0, 20)->toInstant(ZoneOffset::UTC()), Instant::ofEpochSecond(10, 200), null], [Instant::ofEpochSecond(10, 200), OffsetDateTime::of(1970, 1, 1, 0, 0, 20, 10, ZoneOffset::UTC()), OffsetDateTime::of(1970, 1, 1, 0, 0, 10, 200, ZoneOffset::UTC()), null], [Instant::ofEpochSecond(10, 200), OffsetDateTime::of(1970, 1, 1, 0, 0, 20, 10, self::OFFSET_PTWO()), OffsetDateTime::of(1970, 1, 1, 2, 0, 10, 200, self::OFFSET_PTWO()), null], [Instant::ofEpochSecond(10, 200), ZonedDateTime::of(1970, 1, 1, 0, 0, 20, 10, self::ZONE_PARIS()), ZonedDateTime::of(1970, 1, 1, 1, 0, 10, 200, self::ZONE_PARIS()), null], [Instant::ofEpochSecond(10, 200), LocalDateTime::of(1970, 1, 1, 0, 0, 20), null, DateTimeException::class]]; }