3v4l.org

run code in 300+ PHP versions simultaneously
<?php function file_format_size($bytes, $decimals = 2) { $unit_list = array('B', 'KB', 'MB', 'GB', 'PB'); if ($bytes == 0) { return $bytes . ' ' . $unit_list[0]; } $unit_count = count($unit_list); for ($i = $unit_count - 1; $i >= 0; $i--) { $power = $i * 10; if (($bytes >> $power) >= 1) return round($bytes / (1 << $power), $decimals) . ' ' . $unit_list[$i]; } } foreach ([0, 10, 100, 1000, 1024, 10000, 100000, 1000000, 10000000] as $bytes) { var_export(file_format_size($bytes)); echo "\n"; }

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.5.10.0090.01116.74
8.5.00.0120.01020.08
8.4.150.0020.00114.05
8.4.140.0150.00617.56
8.4.130.0120.00917.74
8.4.120.0120.00920.57
8.4.110.0120.00818.47
8.4.100.0110.00917.80
8.4.90.0140.00522.49
8.4.80.0060.00317.70
8.4.70.0100.00917.71
8.4.60.0110.01018.86
8.4.50.0100.00917.55
8.4.40.0100.01017.59
8.4.30.0130.00718.73
8.4.20.0170.00018.61
8.4.10.0060.00319.49
8.3.280.0100.01020.04
8.3.270.0140.01116.36
8.3.260.0090.00716.64
8.3.250.0140.00518.85
8.3.240.0100.00916.33
8.3.230.0090.01116.55
8.3.220.0050.00417.05
8.3.210.0100.00918.54
8.3.200.0040.00516.52
8.3.190.0060.00318.99
8.3.180.0100.00816.57
8.3.170.0160.00319.21
8.3.160.0100.01016.58
8.3.150.0180.00020.55
8.3.140.0000.01017.02
8.3.130.0060.01216.66
8.3.120.0060.00320.91
8.3.110.0110.00020.94
8.3.100.0060.00324.06
8.3.90.0110.00726.77
8.3.80.0070.00416.50
8.3.70.0120.00316.63
8.3.60.0100.01018.05
8.3.50.0110.00718.00
8.3.40.0090.00618.77
8.3.30.0140.00418.65
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0050.00326.16
8.2.290.0100.00720.67
8.2.280.0060.00318.60
8.2.270.0070.00017.16
8.2.260.0150.00018.80
8.2.250.0030.00618.53
8.2.240.0100.01016.98
8.2.230.0070.00422.58
8.2.220.0090.00937.54
8.2.210.0050.00326.77
8.2.200.0060.00316.50
8.2.190.0070.01516.63
8.2.180.0060.00925.92
8.2.170.0090.01219.21
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00726.35
8.2.110.0050.00520.84
8.2.100.0030.00817.96
8.2.90.0000.00817.75
8.2.80.0030.00618.85
8.2.70.0000.00918.05
8.2.60.0030.00518.34
8.2.50.0040.00418.10
8.2.40.0060.00319.42
8.2.30.0020.00519.45
8.2.20.0040.00718.12
8.2.10.0080.00021.19
8.2.00.0000.00819.35
8.1.330.0130.00621.92
8.1.320.0090.01016.06
8.1.310.0130.00616.77
8.1.300.0090.00615.92
8.1.290.0090.00018.88
8.1.280.0190.00325.92
8.1.270.0000.00724.66
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0060.00323.97
8.1.230.0110.00017.89
8.1.220.0050.00317.74
8.1.210.0090.00018.77
8.1.200.0060.00317.35
8.1.190.0080.00017.22
8.1.180.0080.00018.10
8.1.170.0060.00318.74
8.1.160.0000.00718.98
8.1.150.0050.00218.68
8.1.140.0000.00718.99
8.1.130.0040.00420.10
8.1.120.0030.00317.53
8.1.110.0040.00417.48
8.1.100.0030.00617.46
8.1.90.0020.00517.40
8.1.80.0000.00917.51
8.1.70.0050.00517.33
8.1.60.0000.00817.64
8.1.50.0030.00617.61
8.1.40.0000.00817.56
8.1.30.0030.00617.54
8.1.20.0000.00817.58
8.1.10.0030.00517.69
8.1.00.0080.00017.54
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0030.00318.51
8.0.270.0080.00018.06
8.0.260.0030.00318.53
8.0.250.0030.00317.00
8.0.240.0030.00516.98
8.0.230.0000.00717.00
8.0.220.0020.00516.83
8.0.210.0000.00716.96
8.0.200.0060.00017.00
8.0.190.0000.00816.96
8.0.180.0050.00316.99
8.0.170.0100.00016.92
8.0.160.0040.00417.01
8.0.150.0080.00016.98
8.0.140.0000.00716.91
8.0.130.0000.00513.36
8.0.120.0030.00716.97
8.0.110.0080.00016.93
8.0.100.0070.00017.00
8.0.90.0040.00416.80
8.0.80.0070.01116.96
8.0.70.0000.00717.01
8.0.60.0050.00316.88
8.0.50.0050.00316.91
8.0.30.0040.01116.95
8.0.20.0130.01016.99
8.0.10.0120.00617.01
8.0.00.0090.00617.04
7.4.330.0030.00315.55
7.4.320.0000.00716.52
7.4.300.0030.00316.56
7.4.290.0000.00716.59
7.4.280.0000.00816.65
7.4.270.0000.00816.68
7.4.260.0030.00313.36
7.4.250.0000.00716.43
7.4.240.0020.00516.66
7.4.230.0070.00016.45
7.4.220.0040.00316.58
7.4.210.0110.00416.65
7.4.200.0070.00016.64
7.4.160.0090.01216.59
7.4.150.0070.00716.61
7.4.140.0060.01016.48
7.4.130.0120.00916.60
7.4.120.0110.00716.62
7.4.110.0040.01316.58
7.4.100.0070.01416.45
7.4.90.0140.00016.63
7.4.80.0050.00916.53
7.4.70.0040.01116.45
7.4.60.0030.01316.42
7.4.50.0100.00716.43
7.4.40.0030.01516.39
7.4.30.0070.00716.43
7.4.20.0110.00316.39
7.4.10.0110.00416.65
7.4.00.0120.00616.49
7.3.330.0000.00716.31
7.3.320.0050.00013.51
7.3.310.0030.00316.49
7.3.300.0040.00416.43
7.3.290.0070.00916.44
7.3.270.0040.01116.31
7.3.260.0120.00916.34
7.3.250.0000.01616.41
7.3.240.0120.00316.43
7.3.230.0060.01216.34
7.3.220.0040.01116.37
7.3.210.0060.00616.27
7.3.200.0060.00816.38
7.3.190.0040.01716.33
7.3.180.0130.00316.50
7.3.170.0000.01716.32
7.3.160.0130.00616.35
7.3.150.0120.00316.27
7.3.140.0120.00616.36
7.3.130.0090.00916.38
7.3.120.0110.00416.36
7.3.110.0030.01316.37
7.3.100.0070.01016.27
7.3.90.0070.01016.62
7.3.80.0060.00916.30
7.3.70.0050.01016.49
7.3.60.0030.01216.61
7.3.50.0000.01516.50
7.3.40.0070.00716.54
7.3.30.0140.00016.54
7.3.20.0090.01216.56
7.3.10.0060.00916.50
7.3.00.0080.00616.50

preferences:
164.97 ms | 403 KiB | 5 Q