3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_timezone_from_offset(int $offset): \DateTimeZone { $isAbs = $offset >= 0; $offset = abs($offset); $offset = number_format($offset / 60 / 60, 2, ' ', ''); #$offset = str_pad($offset, 4, '0', STR_PAD_LEFT); #$offset = $isAbs ? '+'.$offset : '-'.$offset; dump($offset); die; return new \DateTimeZone($offset); } var_dump(get_timezone_from_offset(-7200));

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.60.0210.00018.43
8.3.50.0120.00318.30
8.3.40.0130.00618.83
8.3.30.0070.00718.84
8.3.20.0080.00019.18
8.3.10.0050.00323.65
8.3.00.0080.00020.66
8.2.180.0040.01118.29
8.2.170.0070.00722.96
8.2.160.0130.00322.26
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0150.00419.83
8.2.120.0110.00326.35
8.2.110.0090.00021.06
8.2.100.0040.00817.84
8.2.90.0050.00517.81
8.2.80.0040.00417.97
8.2.70.0040.00417.93
8.2.60.0040.00418.22
8.2.50.0080.00018.10
8.2.40.0080.00019.33
8.2.30.0070.00019.20
8.2.20.0040.00418.04
8.2.10.0040.00418.18
8.2.00.0040.00417.73
8.1.280.0070.01025.92
8.1.270.0080.00020.61
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0080.00024.09
8.1.230.0120.00022.63
8.1.220.0030.00617.76
8.1.210.0090.00018.77
8.1.200.0070.00717.34
8.1.190.0000.00917.13
8.1.180.0000.00818.10
8.1.170.0040.00418.72
8.1.160.0070.00018.98
8.1.150.0000.00818.96
8.1.140.0070.00022.14
8.1.130.0070.00020.24
8.1.120.0000.00817.51
8.1.110.0070.00017.54
8.1.100.0070.00017.45
8.1.90.0030.00517.54
8.1.80.0000.00817.47
8.1.70.0000.00717.42
8.1.60.0060.00317.64
8.1.50.0000.00817.64
8.1.40.0040.00417.53
8.1.30.0040.00417.64
8.1.20.0030.00617.59
8.1.10.0040.00417.62
8.1.00.0000.00817.53
8.0.300.0040.00419.77
8.0.290.0000.00716.75
8.0.280.0070.00018.43
8.0.270.0000.00817.30
8.0.260.0000.00618.52
8.0.250.0000.00717.03
8.0.240.0000.00717.02
8.0.230.0030.00517.10
8.0.220.0000.00817.02
8.0.210.0030.00316.99
8.0.200.0030.00316.99
8.0.190.0000.00817.04
8.0.180.0000.00816.92
8.0.170.0060.00316.91
8.0.160.0070.00016.99
8.0.150.0070.00016.82
8.0.140.0040.00416.93
8.0.130.0050.00013.37
8.0.120.0000.00816.88
8.0.110.0000.00716.96
8.0.100.0000.00816.91
8.0.90.0050.00216.81
8.0.80.0130.00516.99
8.0.70.0000.00816.91
8.0.60.0040.00416.98
8.0.50.0080.00016.99
8.0.30.0070.01117.32
8.0.20.0050.01417.40
8.0.10.0040.00417.01
8.0.00.0100.00816.85
7.4.330.0000.00615.55
7.4.320.0030.00316.66
7.4.300.0060.00016.47
7.4.290.0030.00316.70
7.4.280.0030.00516.57
7.4.270.0000.00716.52
7.4.260.0070.00016.54
7.4.250.0000.00716.64
7.4.240.0030.00316.58
7.4.230.0040.00416.66
7.4.220.0070.00016.68
7.4.210.0100.00816.62
7.4.200.0030.00316.66
7.4.160.0080.00916.64
7.4.140.0130.00717.86
7.4.130.0070.01016.70
7.4.120.0120.00716.55
7.4.110.0140.00916.47
7.4.100.0130.00316.53
7.4.90.0030.01516.44
7.4.80.0140.00319.39
7.4.70.0030.01316.75
7.4.60.0100.00616.55
7.4.50.0050.00516.63
7.4.40.0100.00716.56
7.3.330.0050.00013.30
7.3.320.0050.00013.46
7.3.310.0030.00516.29
7.3.300.0040.00216.41
7.3.290.0000.00716.51
7.3.280.0010.01316.43
7.3.260.0120.00716.55
7.3.240.0090.01116.53
7.3.230.0150.00316.71
7.3.210.0000.01616.40
7.3.200.0090.00816.56
7.3.190.0100.00616.54
7.3.180.0100.01016.50
7.3.170.0120.00616.51
7.3.160.0120.00616.50
7.2.330.0130.00616.79
7.2.320.0120.00816.41
7.2.310.0100.00716.50
7.2.300.0100.00716.68
7.2.290.0080.00916.54

preferences:
56.25 ms | 400 KiB | 5 Q