3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timezones = [ 'LA (USA)' => 'America/Los_Angeles', 'New York (USA)' => 'America/New_York', 'Paris (FR)' => 'Europe/Paris', 'Brisbane (Aus)' => 'Australia/Brisbane', ]; $locales = [ 'American' => 'en-US', 'Australian' => 'en-AU', 'British' =>'en-UK', 'Canadian' => 'en-CA', 'French Canadian' => 'fr-CA', 'French' => 'fr-FR', 'Japanese' => 'ja-JP', ]; $absoluteDate = new DateTimeImmutable('2024-12-06T03:02:01.123456Z'); foreach ($timezones as $place => $tzName) { echo "\n\n7 people in {$place}, each looking at their computer to find the time and date:"; foreach ($locales as $nationality => $locale) { $fullFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone($tzName) ); $shortFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, new DateTimeZone($tzName) ); $shortDateOnlyFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::SHORT, IntlDateFormatter::NONE, new DateTimeZone($tzName) ); echo "\n The {$nationality} one sees: - Full: {$fullFormatter->format($absoluteDate)} - Short: {$shortFormatter->format($absoluteDate)} - Short date: {$shortDateOnlyFormatter->format($absoluteDate)}"; } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.10.0110.00424.55
8.3.140.0100.02123.46
8.3.130.0070.00723.56
8.3.120.0040.01123.98
8.3.110.0030.01423.46
8.3.100.0000.01724.06
8.3.90.0090.00626.77
8.3.80.0100.01022.00
8.3.70.0360.01821.75
8.3.60.0110.02121.88
8.3.50.0160.02321.72
8.3.40.0350.01622.13
8.2.260.0100.00722.21
8.2.250.0160.01321.94
8.2.240.0060.01022.23
8.2.230.0060.01022.58
8.2.220.0090.00637.54
8.2.210.0070.02826.77
8.2.200.0070.01822.13
8.2.190.0200.03021.63
8.2.180.0220.01023.75
8.2.170.0210.01424.13
8.1.310.0100.02622.09
8.1.300.0090.00621.28
8.1.290.0060.01230.84
8.1.280.0060.02623.18

preferences:
26.07 ms | 403 KiB | 5 Q