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('ET', '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.70.0110.00316.50
8.3.60.0110.00718.38
8.3.50.0100.00822.01
8.3.40.0120.00918.92
8.3.30.0100.01019.27
8.3.20.0050.00320.19
8.3.10.0050.00323.48
8.3.00.0040.01119.50
8.2.180.0110.00416.38
8.2.170.0140.00722.96
8.2.160.0100.00320.39
8.2.150.0070.01124.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00020.88
8.2.110.0120.00019.20
8.2.100.0040.00818.09
8.2.90.0040.00418.15
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0040.00418.05
8.2.50.0030.00518.07
8.2.40.0080.00018.02
8.2.30.0050.00317.98
8.2.20.0070.00017.81
8.2.10.0000.00818.11
8.2.00.0000.00817.91
8.1.280.0100.00725.92
8.1.270.0060.00322.23
8.1.260.0000.00926.35
8.1.250.0050.00328.09
8.1.240.0030.00722.53
8.1.230.0080.00420.89
8.1.220.0040.00417.74
8.1.210.0030.00818.88
8.1.200.0030.00717.38
8.1.190.0030.00517.47
8.1.180.0050.00318.10
8.1.170.0040.00418.52
8.1.160.0040.00422.01
8.1.150.0040.00418.77
8.1.140.0070.00017.46
8.1.130.0040.00417.73
8.1.120.0030.00517.54
8.1.110.0030.00517.54
8.1.100.0050.00217.51
8.1.90.0040.00417.51
8.1.80.0040.00417.47
8.1.70.0000.00717.54
8.1.60.0030.00517.57
8.1.50.0050.00317.54
8.1.40.0030.01017.48
8.1.30.0060.00317.54
8.1.20.0030.00617.55
8.1.10.0000.00817.61
8.1.00.0040.00417.56
8.0.300.0040.00420.04
8.0.290.0040.00416.75
8.0.280.0080.00018.32
8.0.270.0030.00317.32
8.0.260.0030.00317.23
8.0.250.0000.00717.00
8.0.240.0040.00417.07
8.0.230.0030.00317.00
8.0.220.0030.00316.92
8.0.210.0070.00016.94
8.0.200.0030.00317.05
8.0.190.0070.00317.06
8.0.180.0070.00017.05
8.0.170.0030.00617.11
8.0.160.0070.00017.07
8.0.150.0040.00416.85
8.0.140.0050.00316.88
8.0.130.0000.00613.47
8.0.120.0000.00816.97
8.0.110.0040.00416.98
8.0.100.0040.00416.96
8.0.90.0000.00717.04
8.0.80.0000.01816.97
8.0.70.0020.00516.91
8.0.60.0020.00516.80
8.0.50.0000.00816.90
8.0.30.0080.01417.22
8.0.20.0070.01117.41
8.0.10.0040.00417.20
8.0.00.0100.00716.93
7.4.330.0000.00515.07
7.4.320.0000.00716.62
7.4.300.0030.00316.65
7.4.290.0050.00316.61
7.4.280.0070.00316.48
7.4.270.0030.00316.52
7.4.260.0050.00216.60
7.4.250.0060.00316.46
7.4.240.0020.00616.56
7.4.230.0000.00716.59
7.4.220.0130.01316.38
7.4.210.0070.00716.57
7.4.200.0030.00316.68
7.4.160.0100.00616.54
7.4.150.0120.00617.40
7.4.140.0120.00617.86
7.4.130.0080.00916.49
7.4.120.0120.00916.57
7.4.110.0030.01416.30
7.4.100.0090.00916.73
7.4.90.0070.00916.73
7.4.80.0090.00919.39
7.4.70.0110.00516.55
7.4.60.0120.00416.54
7.4.50.0000.00816.84
7.4.40.0150.00916.50
7.4.30.0130.00316.38
7.4.10.0030.01515.18
7.4.00.0090.00814.87
7.3.330.0000.00613.39
7.3.320.0030.00313.20
7.3.310.0000.00716.30
7.3.300.0000.00716.43
7.3.290.0030.01316.45
7.3.280.0110.00616.37
7.3.270.0130.00617.40
7.3.260.0210.00316.51
7.3.250.0100.00716.51
7.3.240.0090.00916.66
7.3.230.0090.00916.65
7.3.210.0000.01716.56
7.3.200.0080.01319.39
7.3.190.0140.00416.63
7.3.180.0130.00316.61
7.3.170.0030.01316.55
7.3.160.0120.00416.35
7.3.130.0110.00715.05
7.3.120.0080.01114.99
7.3.110.0050.01214.98
7.3.100.0060.00914.82
7.3.90.0110.00514.85
7.3.80.0030.01114.66
7.3.70.0050.00614.82
7.3.60.0060.00914.77
7.3.50.0000.01615.05
7.3.40.0080.01014.65
7.3.30.0050.00614.98
7.3.20.0050.00916.62
7.3.10.0090.00716.80
7.3.00.0050.00916.63
7.2.330.0140.00316.67
7.2.320.0090.00816.52
7.2.310.0080.00816.81
7.2.300.0030.01516.46
7.2.290.0120.01216.75
7.2.260.0100.01014.82
7.2.250.0040.01414.71
7.2.240.0080.00815.06
7.2.230.0050.01114.92
7.2.220.0040.00814.93
7.2.210.0080.00515.07
7.2.200.0020.01314.99
7.2.190.0050.01214.94
7.2.180.0070.01014.94
7.2.170.0060.00614.87
7.2.160.0040.00415.04
7.2.150.0110.00417.13
7.2.140.0120.00616.87
7.2.130.0050.00716.81
7.2.120.0030.01016.82
7.2.110.0080.00516.92
7.2.100.0050.01116.88
7.2.90.0050.01116.86
7.2.80.0080.00516.75
7.2.70.0030.00816.72
7.2.60.0060.00716.84
7.2.50.0100.00616.85
7.2.40.0040.00616.99
7.2.30.0100.00516.79
7.2.20.0050.00717.00
7.2.10.0070.00317.03
7.2.00.0030.00717.71
7.1.330.0030.00916.02
7.1.320.0110.00215.93
7.1.310.0050.00715.96
7.1.300.0030.00815.86
7.1.290.0060.00615.85
7.1.280.0080.00515.57
7.1.270.0030.00915.76
7.1.260.0050.01015.63
7.1.250.0050.00715.64
7.1.240.0000.00915.98
7.1.230.0060.01015.38
7.1.220.0090.00615.70
7.1.210.0040.00715.53
7.1.200.0070.00515.74
7.1.190.0100.00315.69
7.1.180.0040.00715.92
7.1.170.0090.00616.04
7.1.160.0060.00615.74
7.1.150.0000.01615.93
7.1.140.0030.00915.84
7.1.130.0000.01415.52
7.1.120.0070.00315.92
7.1.110.0030.00715.68
7.1.100.0030.00916.96
7.1.90.0030.00915.58
7.1.80.0070.00315.79
7.1.70.0010.00716.35
7.1.60.0100.01017.54
7.1.50.0100.00916.37
7.1.40.0030.00715.72
7.1.30.0130.00015.87
7.1.20.0000.01115.88
7.1.10.0040.00715.61
7.1.00.0000.04319.13
7.0.330.0030.00915.41
7.0.320.0090.00615.36
7.0.310.0060.00615.48
7.0.300.0050.00315.36
7.0.290.0070.00715.28
7.0.280.0100.00315.59
7.0.270.0060.00915.59
7.0.260.0030.01015.34
7.0.250.0070.00315.58
7.0.240.0080.00615.17
7.0.230.0000.00915.64
7.0.220.0040.00815.57
7.0.210.0070.00415.18
7.0.200.0040.00616.12
7.0.190.0040.01115.36
7.0.180.0000.00815.40
7.0.170.0000.00815.62
7.0.160.0060.00915.35
7.0.150.0070.00315.60
7.0.140.0050.03918.81
7.0.130.0060.00315.14
7.0.120.0030.01015.59
7.0.110.0070.00415.39
7.0.100.0000.00815.35
7.0.90.0000.01515.55
7.0.80.0100.00315.50
7.0.70.0030.00615.35
7.0.60.0100.03517.68
7.0.50.0090.02516.60
7.0.40.0120.04116.62
7.0.30.0160.02116.80
7.0.20.0150.02516.90
7.0.10.0130.04316.86
7.0.00.0090.04616.75
5.6.400.0060.01014.48
5.6.390.0060.01014.39
5.6.380.0000.01014.43
5.6.370.0040.00414.37
5.6.360.0100.00714.54
5.6.350.0140.00014.36
5.6.340.0070.00714.35
5.6.330.0070.00714.50
5.6.320.0100.00314.31
5.6.310.0000.00914.35
5.6.300.0000.01114.36
5.6.290.0030.00914.30
5.6.280.0030.04317.65
5.6.270.0060.00314.70
5.6.260.0000.01614.21
5.6.250.0100.00014.16
5.6.240.0030.00714.37
5.6.230.0070.00714.28
5.6.220.0060.00314.30
5.6.210.0100.04217.59
5.6.200.0080.04416.36
5.6.190.0050.02417.58
5.6.180.0160.02317.39
5.6.170.0100.03417.31
5.6.160.0100.03517.45
5.6.150.0030.02516.23
5.6.140.0020.03016.28
5.6.130.0070.04216.33
5.6.120.0030.02617.59
5.6.110.0080.05017.68
5.6.100.0070.03917.63
5.6.90.0080.04817.58
5.6.80.0060.02117.37
5.6.70.2190.02617.36
5.6.60.0030.01314.28
5.6.50.0000.01014.20
5.6.40.0040.01214.48
5.6.30.0000.01314.16
5.6.20.0060.00314.41
5.6.10.0000.01014.25
5.6.00.0140.00014.46
5.5.380.0060.00314.40
5.5.370.0060.00914.23
5.5.360.0110.00414.28
5.5.350.0100.04517.54
5.5.340.0030.04016.05
5.5.330.0040.03117.43
5.5.320.0020.02717.44
5.5.310.0160.02617.27
5.5.300.0030.02616.09
5.5.290.0100.04216.15
5.5.280.0020.04317.75
5.5.270.0180.03217.66
5.5.260.0100.03517.57
5.5.250.0080.02217.65
5.5.240.0070.04317.35
5.5.230.0000.01714.07
5.5.220.0030.01414.02
5.5.210.0060.00614.42
5.5.200.0060.00314.41
5.5.190.0100.00314.07
5.5.180.0050.00514.18
5.5.170.0000.01514.40
5.5.160.0070.00714.18
5.5.150.0040.00714.42
5.5.140.0100.00314.32
5.5.130.0050.00314.35
5.5.120.0070.00714.05
5.5.110.0030.01014.08
5.5.100.0060.00314.05
5.5.90.0030.01414.35
5.5.80.0040.01414.01
5.5.70.0040.01414.30
5.5.60.0030.01014.08
5.5.50.0070.00714.38
5.5.40.0130.00014.46
5.5.30.0110.00414.13
5.5.20.0070.00714.32
5.5.10.0000.01014.16
5.5.00.0000.01314.33
5.4.450.0200.02515.95
5.4.440.0370.02215.99
5.4.430.0180.02515.99
5.4.420.0330.00716.00
5.4.410.0350.00515.85
5.4.400.0320.00515.76
5.4.390.0320.00515.78
5.4.380.0350.00515.80
5.4.370.0320.00415.80
5.4.360.0320.00615.78
5.4.350.0330.00315.73
5.4.340.0050.02012.23
5.4.330.0000.01312.44
5.4.320.0040.02312.47
5.4.310.0030.02312.47
5.4.300.0060.02212.47
5.4.290.0060.02112.47
5.4.280.0050.02012.42
5.4.270.0050.02512.42
5.4.260.0070.02112.42
5.4.250.0070.02312.42
5.4.240.0050.02512.42
5.4.230.0060.02112.41
5.4.220.0030.02212.41
5.4.210.0040.02312.41
5.4.200.0070.02512.41
5.4.190.0030.02112.41
5.4.180.0040.02312.41
5.4.170.0050.02412.42
5.4.160.0080.01812.41
5.4.150.0060.02012.41
5.4.140.0040.02212.26
5.4.130.0060.02112.25
5.4.120.0060.02612.23
5.4.110.0050.02312.23
5.4.100.0040.02312.22
5.4.90.0040.02112.22
5.4.80.0050.02012.22
5.4.70.0040.01812.22
5.4.60.0040.02212.22
5.4.50.0030.02212.22
5.4.40.0030.02212.22
5.4.30.0080.02212.21
5.4.20.0040.02312.22
5.4.10.0060.02112.21
5.4.00.0020.02411.96
5.3.290.0070.03812.80
5.3.280.0080.03612.71
5.3.270.0100.04112.73
5.3.260.0040.04112.72
5.3.250.0060.03812.72
5.3.240.0060.04112.72
5.3.230.0060.03812.71
5.3.220.0120.04812.68
5.3.210.0080.04312.68
5.3.200.0090.03712.68
5.3.190.0080.04912.68
5.3.180.0110.04812.67
5.3.170.0090.04112.67
5.3.160.0070.03812.67
5.3.150.0070.03612.67
5.3.140.0080.03412.66
5.3.130.0040.04212.66
5.3.120.0050.04112.66
5.3.110.0060.04712.66
5.3.100.0080.03612.13
5.3.90.0070.03612.11
5.3.80.0080.04112.10
5.3.70.0040.03912.10
5.3.60.0070.03612.08
5.3.50.0060.03712.03
5.3.40.0050.03712.03
5.3.30.0080.03211.99
5.3.20.0090.03611.77
5.3.10.0060.03511.74
5.3.00.0040.03811.72
5.2.170.0050.0309.23
5.2.160.0070.0269.23
5.2.150.0040.0349.23
5.2.140.0040.0319.22
5.2.130.0030.0449.19
5.2.120.0030.0309.18
5.2.110.0050.0299.19
5.2.100.0080.0299.18
5.2.90.0060.0289.18
5.2.80.0030.0329.18
5.2.70.0030.0319.18
5.2.60.0030.0329.13
5.2.50.0050.0329.11
5.2.40.0040.0319.08
5.2.30.0040.0319.05
5.2.20.0050.0289.05
5.2.10.0090.0258.95
5.2.00.0070.0288.82
5.1.60.0050.0268.09
5.1.50.0040.0248.09
5.1.40.0070.0218.07
5.1.30.0090.0218.42
5.1.20.0060.0308.44
5.1.10.0040.0268.16
5.1.00.0020.0318.17
5.0.50.0030.0216.64
5.0.40.0060.0226.50
5.0.30.0050.0376.32
5.0.20.0030.0206.28
5.0.10.0050.0186.26
5.0.00.0040.0306.25
4.4.90.0050.0134.78
4.4.80.0020.0164.75
4.4.70.0020.0284.76
4.4.60.0020.0174.75
4.4.50.0050.0214.77
4.4.40.0020.0264.71
4.4.30.0040.0144.76
4.4.20.0040.0144.85
4.4.10.0060.0184.85
4.4.00.0020.0264.76
4.3.110.0050.0184.67
4.3.100.0020.0164.66
4.3.90.0060.0124.64
4.3.80.0040.0274.59
4.3.70.0030.0164.63
4.3.60.0030.0164.63
4.3.50.0020.0164.63
4.3.40.0030.0234.54
4.3.30.0020.0163.30
4.3.20.0020.0163.28
4.3.10.0030.0143.24
4.3.00.0030.02010.63

preferences:
72.52 ms | 401 KiB | 5 Q