3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://stackoverflow.com/questions/26453510/datetimezone-and-utc-offset-for-standard-and-daylight-times */ /** * @param $seconds * * @return string +\d\d\d\d / -\d\d\d\d */ function format_offset($seconds) { $minutes = (int) ($seconds / 60); $hours = (int) ($minutes / 60); $leftover = abs($minutes - $hours * 60); return sprintf("%+03d%02d", $hours, $leftover); } $zones = array('US/Eastern', 'EDT', 'EST'); foreach ($zones as $zone) { // get offset $timezone = new DateTimeZone($zone); $offset = $timezone->getOffset(new DateTime(null, $timezone)); printf("%s (%s) %s\n", $zone, $timezone->getName(), format_offset($offset)); }

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.3.40.0090.00619.02
8.3.30.0130.00618.96
8.3.20.0070.00020.30
8.3.10.0000.00723.53
8.3.00.0000.00819.51
8.2.170.0110.00422.96
8.2.160.0110.00420.39
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0040.00422.23
8.2.110.0120.00021.00
8.2.100.0090.00318.03
8.2.90.0030.00617.97
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0040.00418.04
8.2.50.0030.00618.07
8.2.40.0030.00618.34
8.2.30.0000.00918.18
8.2.20.0030.00517.95
8.2.10.0040.00418.12
8.2.00.0040.00417.95
8.1.270.0030.00622.14
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.65
8.1.230.0090.00320.98
8.1.220.0050.00317.78
8.1.210.0100.00318.77
8.1.200.0050.00517.48
8.1.190.0030.00617.25
8.1.180.0060.00318.10
8.1.170.0080.00018.80
8.1.160.0040.00422.01
8.1.150.0040.00418.89
8.1.140.0040.00417.59
8.1.130.0070.00017.83
8.1.120.0000.00717.61
8.1.110.0040.00417.59
8.1.100.0040.00417.55
8.1.90.0040.00417.50
8.1.80.0000.00717.58
8.1.70.0000.00717.53
8.1.60.0030.00617.65
8.1.50.0030.00617.60
8.1.40.0030.00617.46
8.1.30.0080.00017.73
8.1.20.0000.00817.66
8.1.10.0000.00817.64
8.1.00.0040.00417.62
8.0.300.0050.00319.90
8.0.290.0040.00416.88
8.0.280.0050.00218.36
8.0.270.0070.00017.27
8.0.260.0030.00317.18
8.0.250.0000.00716.99
8.0.240.0050.00317.04
8.0.230.0070.00016.94
8.0.220.0040.00417.05
8.0.210.0030.00316.95
8.0.200.0000.00717.05
8.0.190.0040.00817.10
8.0.180.0040.00417.13
8.0.170.0000.00916.93
8.0.160.0000.00716.95
8.0.150.0040.00416.95
8.0.140.0070.00016.98
8.0.130.0060.00013.41
8.0.120.0040.00816.89
8.0.110.0040.00416.90
8.0.100.0050.00517.08
8.0.90.0000.00817.05
8.0.80.0070.01017.00
8.0.70.0040.00416.89
8.0.60.0000.00817.01
8.0.50.0000.00816.85
8.0.30.0090.00917.33
8.0.20.0050.01717.40
8.0.10.0000.00717.05
8.0.00.0120.00816.83
7.4.330.0060.00015.00
7.4.320.0050.00216.52
7.4.300.0030.00316.55
7.4.290.0000.00716.70
7.4.280.0050.00516.55
7.4.270.0000.00716.72
7.4.260.0030.00316.61
7.4.250.0070.00016.58
7.4.240.0020.00616.57
7.4.230.0070.00016.50
7.4.220.0000.01816.65
7.4.210.0120.00916.72
7.4.200.0000.00816.74
7.4.160.0060.00916.55
7.4.150.0120.00617.40
7.4.140.0110.00617.86
7.4.130.0100.01016.68
7.4.120.0090.00916.58
7.4.110.0120.00616.72
7.4.100.0070.01016.72
7.4.90.0070.01016.68
7.4.80.0100.01019.39
7.4.70.0100.00716.67
7.4.60.0060.01016.84
7.4.50.0040.00416.34
7.4.40.0060.01616.62
7.4.30.0080.01216.49
7.4.10.0130.00614.94
7.4.00.0030.01315.14
7.3.330.0050.00013.26
7.3.320.0030.00313.51
7.3.310.0000.00716.50
7.3.300.0050.00216.51
7.3.290.0090.01216.56
7.3.280.0050.01016.49
7.3.270.0140.00517.40
7.3.260.0150.00916.68
7.3.250.0090.00816.72
7.3.240.0090.00916.86
7.3.230.0120.01016.59
7.3.210.0090.00916.74
7.3.200.0130.00616.73
7.3.190.0100.00816.79
7.3.180.0060.00916.51
7.3.170.0110.01116.52
7.3.160.0100.00716.53
7.3.130.0100.00714.87
7.3.120.0090.00814.95
7.3.110.0070.01015.01
7.3.100.0040.01115.11
7.3.90.0030.01015.02
7.3.80.0040.01115.04
7.3.70.0060.00915.07
7.3.60.0030.01215.12
7.3.50.0000.01314.79
7.3.40.0070.00614.85
7.3.30.0050.00714.87
7.3.20.0060.00616.87
7.3.10.0100.00316.80
7.3.00.0060.00616.74
7.2.330.0170.00416.70
7.2.320.0070.01016.85
7.2.310.0100.01016.68
7.2.300.0060.01016.66
7.2.290.0190.00616.47
7.2.260.0080.01214.99
7.2.250.0090.00914.89
7.2.240.0060.00915.22
7.2.230.0080.00615.26
7.2.220.0060.00415.19
7.2.210.0100.00514.93
7.2.200.0040.00915.23
7.2.190.0070.00515.04
7.2.180.0030.01215.01
7.2.170.0070.00915.14
7.2.160.0070.00515.10
7.2.150.0060.00617.07
7.2.140.0060.00617.06
7.2.130.0100.00517.04
7.2.120.0080.00817.15
7.2.110.0060.00616.89
7.2.100.0070.00917.01
7.2.90.0070.00716.95
7.2.80.0100.00517.12
7.2.70.0030.01017.15
7.2.60.0060.00917.04
7.2.50.0090.00417.02
7.2.40.0100.00716.87
7.2.30.0110.00517.06
7.2.20.0080.00717.09
7.2.10.0080.00817.15
7.2.00.0030.01217.83
7.1.330.0100.00515.77
7.1.320.0040.00815.97
7.1.310.0090.00515.63
7.1.300.0060.00615.79
7.1.290.0050.01015.74
7.1.280.0000.01115.82
7.1.270.0100.00115.76
7.1.260.0090.00515.79
7.1.250.0010.01415.74
7.1.240.0040.00715.88
7.1.230.0070.01015.78
7.1.220.0000.00915.68
7.1.210.0060.00315.85
7.1.200.0070.00915.98
7.1.190.0000.01415.95
7.1.180.0100.00315.94
7.1.170.0000.01715.94
7.1.160.0070.01015.44
7.1.150.0140.00316.03
7.1.140.0100.00716.06
7.1.130.0090.00915.81
7.1.120.0100.00715.59
7.1.110.0060.00915.75
7.1.100.0040.00817.12
7.1.90.0100.00815.71
7.1.80.0150.00615.84
7.1.70.0060.01016.53
7.1.60.0110.01117.64
7.1.50.0030.01616.42
7.1.40.0160.00615.90
7.1.30.0100.00715.82
7.1.20.0070.00715.92
7.1.10.0100.00715.76
7.1.00.0030.04419.25
7.0.330.0000.01415.43
7.0.320.0030.01015.56
7.0.310.0090.00615.49
7.0.300.0040.01115.71
7.0.290.0070.01015.54
7.0.280.0050.00515.54
7.0.270.0090.00615.48
7.0.260.0100.00315.65
7.0.250.0070.00715.45
7.0.240.0090.00915.59
7.0.230.0110.00815.58
7.0.220.0000.01715.57
7.0.210.0080.00915.17
7.0.200.0040.01116.20
7.0.190.0080.01115.43
7.0.180.0120.00215.42
7.0.170.0030.01115.28
7.0.160.0070.01015.62
7.0.150.0030.01015.42
7.0.140.0010.04118.81
7.0.130.0040.00815.50
7.0.120.0000.01315.54
7.0.110.0040.00715.58
7.0.100.0090.00615.37
7.0.90.0000.01515.59
7.0.80.0030.00615.59
7.0.70.0040.01115.29
7.0.60.0040.04717.71
7.0.50.0050.02516.67
7.0.40.0030.04316.93
7.0.30.0120.02516.92
7.0.20.0120.02916.81
7.0.10.0050.03716.84
7.0.00.0120.03516.70
5.6.400.0060.00914.50
5.6.390.0100.00714.38
5.6.380.0000.01514.42
5.6.370.0060.01214.33
5.6.360.0030.01214.10
5.6.350.0110.00714.23
5.6.340.0120.00314.84
5.6.330.0130.00914.61
5.6.320.0090.00914.56
5.6.310.0130.01014.48
5.6.300.0040.01214.23
5.6.290.0000.00914.34
5.6.280.0000.04417.83
5.6.270.0040.00714.27
5.6.260.0070.00414.57
5.6.250.0090.00914.36
5.6.240.0030.00614.38
5.6.230.0030.01214.55
5.6.220.0070.00714.46
5.6.210.0050.04417.40
5.6.200.0060.02516.22
5.6.190.0080.04517.49
5.6.180.0170.04217.32
5.6.170.0080.02917.54
5.6.160.0090.04417.39
5.6.150.0070.02516.20
5.6.140.0060.04316.19
5.6.130.0050.03216.46
5.6.120.0070.02817.61
5.6.110.0100.04017.91
5.6.100.0060.04817.59
5.6.90.0080.02517.82
5.6.80.0130.03217.30
5.6.70.2300.02217.45
5.6.60.0080.00414.42
5.6.50.0070.01014.29
5.6.40.0080.00814.27
5.6.30.0030.01614.59
5.6.20.0000.01914.29
5.6.10.0060.00914.35
5.6.00.0120.00314.23
5.5.380.0070.01014.22
5.5.370.0060.00914.30
5.5.360.0040.00913.88
5.5.350.0090.02417.38
5.5.340.0060.03616.03
5.5.330.0070.04117.32
5.5.320.0070.03717.38
5.5.310.0200.02817.29
5.5.300.0020.02716.01
5.5.290.0100.04215.97
5.5.280.0120.03517.54
5.5.270.0060.03417.54
5.5.260.0050.02517.64
5.5.250.0080.02517.36
5.5.240.0180.03617.14
5.5.230.0130.00813.88
5.5.220.0150.00614.04
5.5.210.0080.01114.07
5.5.200.0100.01014.30
5.5.190.0080.01213.92
5.5.180.0140.00313.97
5.5.170.0120.00514.13
5.5.160.0040.01414.18
5.5.150.0060.01614.07
5.5.140.0060.01214.28
5.5.130.0040.01413.88
5.5.120.0100.00714.09
5.5.110.0040.01414.29
5.5.100.0100.00614.24
5.5.90.0110.00814.25
5.5.80.0080.00814.23
5.5.70.0000.01314.16
5.5.60.0140.00514.02
5.5.50.0080.00814.29
5.5.40.0130.00314.47
5.5.30.0100.00714.41
5.5.20.0110.00614.36
5.5.10.0070.00714.45
5.5.00.0000.01814.32
5.4.450.0350.02815.07
5.4.440.0250.02615.41
5.4.430.0400.02315.28
5.4.420.0390.00315.39
5.4.410.0330.00415.14
5.4.400.0360.00515.31
5.4.390.0300.00715.28
5.4.380.0330.00314.95
5.4.370.0320.00615.11
5.4.360.0320.00514.99
5.4.350.0380.00315.26
5.4.340.0060.02211.56
5.4.330.0040.00911.10
5.4.320.0090.01911.70
5.4.310.0100.02012.00
5.4.300.0090.01911.86
5.4.290.0090.02211.71
5.4.280.0080.02711.80
5.4.270.0050.02411.79
5.4.260.0080.02311.84
5.4.250.0060.02811.98
5.4.240.0120.02011.80
5.4.230.0110.02011.87
5.4.220.0080.02512.01
5.4.210.0060.02611.90
5.4.200.0060.02611.68
5.4.190.0060.02611.96
5.4.180.0050.02311.89
5.4.170.0070.02611.81
5.4.160.0110.01811.82
5.4.150.0080.02311.96
5.4.140.0080.02411.60
5.4.130.0070.02211.60
5.4.120.0060.02611.62
5.4.110.0060.02011.65
5.4.100.0060.02111.69
5.4.90.0060.02311.59
5.4.80.0080.02311.61
5.4.70.0040.02911.61
5.4.60.0070.01811.60
5.4.50.0040.02211.68
5.4.40.0070.01811.45
5.4.30.0040.02111.57
5.4.20.0050.02111.54
5.4.10.0040.02111.56
5.4.00.0040.02111.21
5.3.290.0080.04112.80
5.3.280.0090.03912.71
5.3.270.0090.04512.72
5.3.260.0080.04012.72
5.3.250.0040.04712.72
5.3.240.0070.04312.72
5.3.230.0080.03912.71
5.3.220.0090.04412.68
5.3.210.0080.03812.68
5.3.200.0080.03912.68
5.3.190.0110.04112.68
5.3.180.0060.04412.67
5.3.170.0080.03512.67
5.3.160.0080.04112.68
5.3.150.0070.04012.68
5.3.140.0070.03712.66
5.3.130.0060.04112.66
5.3.120.0060.04012.66
5.3.110.0060.03812.66
5.3.100.0060.03812.12
5.3.90.0060.04012.10
5.3.80.0040.04212.10
5.3.70.0060.04612.10
5.3.60.0080.04112.08
5.3.50.0090.04312.02
5.3.40.0080.04812.02
5.3.30.0060.04111.98
5.3.20.0080.03411.76
5.3.10.0110.04011.73
5.3.00.0090.03411.72
5.2.170.0060.0319.22
5.2.160.0060.0319.22
5.2.150.0030.0349.22
5.2.140.0070.0329.22
5.2.130.0050.0309.18
5.2.120.0050.0299.18
5.2.110.0050.0359.18
5.2.100.0050.0409.19
5.2.90.0060.0299.18
5.2.80.0050.0349.18
5.2.70.0050.0309.18
5.2.60.0050.0309.13
5.2.50.0070.0349.11
5.2.40.0010.0359.08
5.2.30.0030.0349.05
5.2.20.0050.0289.05
5.2.10.0050.0328.95
5.2.00.0020.0338.81
5.1.60.0040.0328.09
5.1.50.0030.0328.09
5.1.40.0020.0268.07
5.1.30.0030.0278.42
5.1.20.0060.0248.44
5.1.10.0060.0238.16
5.1.00.0020.0308.16
5.0.50.0040.0216.64
5.0.40.0070.0236.51
5.0.30.0040.0336.31
5.0.20.0020.0216.28
5.0.10.0040.0256.27
5.0.00.0040.0306.26
4.4.90.0040.0144.78
4.4.80.0040.0144.76
4.4.70.0040.0144.75
4.4.60.0020.0164.75
4.4.50.0030.0154.77
4.4.40.0040.0244.70
4.4.30.0030.0154.76
4.4.20.0050.0134.85
4.4.10.0040.0144.85
4.4.00.0020.0324.76
4.3.110.0030.0224.66
4.3.100.0020.0164.66
4.3.90.0030.0144.63
4.3.80.0050.0224.58
4.3.70.0050.0134.63
4.3.60.0020.0174.62
4.3.50.0010.0174.63
4.3.40.0030.0244.53
4.3.30.0040.0143.30
4.3.20.0020.0163.28
4.3.10.0030.0223.24
4.3.00.0270.01310.61

preferences:
39.16 ms | 400 KiB | 5 Q