How can the code provided be optimized for better performance when generating ActiveSync time zones?

The issue with the current code is that it is using a loop to iterate over all time zones, which can be inefficient when dealing with a large number of time zones. To optimize the code for better performance, we can use the DateTimeZone class to get a list of supported time zones directly.

// Get a list of supported time zones using DateTimeZone class
$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);

// Generate ActiveSync time zones
$activeSyncTimeZones = [];
foreach ($timezones as $timezone) {
    $dateTimeZone = new DateTimeZone($timezone);
    $offset = $dateTimeZone->getOffset(new DateTime());
    $activeSyncTimeZones[] = [
        'bias' => $offset / 60,
        'name' => $timezone
    ];
}

// Output ActiveSync time zones
print_r($activeSyncTimeZones);