3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fb1($bytes, $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); // Uncomment one of the following alternatives // $bytes /= pow(1024, $pow); // $bytes /= (1 << (10 * $pow)); return round($bytes, $precision) . ' ' . $units[$pow]; } function fb2($size, $precision = 2) { $base = log($size) / log(1024); $suffixes = array('', 'k', 'M', 'G', 'T'); return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; } function fb3($size) { $base = log($size) / log(1024); $suffix = array("", "k", "M", "G", "T")[floor($base)]; return pow(1024, $base - floor($base)) . $suffix; } echo fb1(24962496) . " 1 \n\n"; echo fb2(24962496) . " 2 \n\n"; echo fb3(24962496) . " 3 \n\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.3.60.0170.00316.75
8.3.50.0100.00616.53
8.3.40.0120.00318.95
8.3.30.0140.00019.42
8.3.20.0040.00420.45
8.3.10.0030.00623.97
8.3.00.0080.00019.51
8.2.180.0070.00717.00
8.2.170.0070.00722.96
8.2.160.0080.00619.38
8.2.150.0040.00424.18
8.2.140.0070.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00022.41
8.2.110.0060.00322.49
8.2.100.0040.00717.88
8.2.90.0060.00319.45
8.2.80.0060.00317.97
8.2.70.0130.00017.86
8.2.60.0050.00318.05
8.2.50.0080.00018.07
8.2.40.0040.00420.01
8.2.30.0000.00818.29
8.2.20.0070.00017.88
8.2.10.0050.00318.26
8.2.00.0030.00617.88
8.1.270.0040.00424.17
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00624.21
8.1.230.0060.00619.51
8.1.220.0040.00417.91
8.1.210.0040.00418.77
8.1.200.0030.00717.47
8.1.190.0030.00517.48
8.1.180.0000.00818.10
8.1.170.0060.00318.82
8.1.160.0000.00722.29
8.1.150.0000.00719.17
8.1.140.0030.00517.66
8.1.130.0030.00318.08
8.1.120.0000.00717.76
8.1.110.0050.00317.58
8.1.100.0020.00517.69
8.1.90.0000.00717.77
8.1.80.0050.00217.70
8.1.70.0070.00017.64
8.1.60.0000.00817.84
8.1.50.0030.00517.70
8.1.40.0000.00817.78
8.1.30.0040.00417.86
8.1.20.0000.00717.95
8.1.10.0040.00417.80
8.1.00.0000.00717.79
8.0.300.0080.00018.77
8.0.290.0040.00417.00
8.0.280.0030.00318.72
8.0.270.0040.00417.53
8.0.260.0000.00717.52
8.0.250.0040.00417.19
8.0.240.0040.00417.30
8.0.230.0030.00317.20
8.0.220.0030.00317.13
8.0.210.0030.00317.14
8.0.200.0110.00017.18
8.0.190.0040.00417.15
8.0.180.0040.00417.22
8.0.170.0060.00317.10
8.0.160.0000.01017.22
8.0.150.0000.00717.10
8.0.140.0050.00217.17
8.0.130.0000.00513.57
8.0.120.0050.00317.16
8.0.110.0000.00817.14
8.0.100.0040.00417.21
8.0.90.0080.00017.19
8.0.80.0100.00717.09
8.0.70.0040.00417.19
8.0.60.0000.00817.04
8.0.50.0040.00417.05
8.0.30.0130.01017.46
8.0.20.0180.00717.40
8.0.10.0040.00417.27
8.0.00.0080.01016.86
7.4.330.0020.00215.29
7.4.320.0040.00416.87
7.4.300.0000.00616.80
7.4.290.0080.00316.87
7.4.280.0000.00816.74
7.4.270.0000.00716.71
7.4.260.0080.00016.74
7.4.250.0040.00416.88
7.4.240.0020.00516.74
7.4.230.0020.00516.90
7.4.220.0070.01116.86
7.4.210.0120.00416.79
7.4.200.0030.00516.90
7.4.160.0110.00716.51
7.4.150.0090.00917.40
7.4.140.0130.00717.86
7.4.130.0110.00516.83
7.4.120.0070.01116.77
7.4.110.0200.00416.82
7.4.100.0140.00316.84
7.4.90.0070.01016.64
7.4.80.0130.00319.39
7.4.70.0000.01516.84
7.4.60.0200.00316.55
7.4.50.0050.00316.62
7.4.40.0120.01216.66
7.4.30.0040.01516.70
7.4.00.0090.00615.26
7.3.330.0050.00013.59
7.3.320.0020.00213.67
7.3.310.0040.00416.66
7.3.300.0000.00716.66
7.3.290.0090.00616.63
7.3.280.0070.01016.59
7.3.270.0200.00317.40
7.3.260.0070.01016.77
7.3.250.0080.00916.85
7.3.240.0200.00016.55
7.3.230.0070.01016.85
7.3.210.0050.01116.70
7.3.200.0120.00619.39
7.3.190.0140.00716.76
7.3.180.0100.00716.76
7.3.170.0030.01316.65
7.3.160.0070.01416.72
7.3.120.0100.00715.58
7.3.110.0040.01115.41
7.3.100.0070.01015.53
7.3.90.0040.00815.32
7.3.80.0100.00715.05
7.3.70.0150.00015.08
7.3.60.0090.00615.30
7.3.50.0030.01514.92
7.3.40.0070.01015.08
7.3.30.0100.00614.93
7.3.20.0090.00316.96
7.3.10.0100.00317.19
7.3.00.0070.00817.13
7.2.330.0170.00017.00
7.2.320.0030.01916.99
7.2.310.0090.01516.88
7.2.300.0120.00616.95
7.2.290.0130.00916.66
7.2.250.0080.01115.52
7.2.240.0080.00815.45
7.2.230.0070.00715.19
7.2.220.0100.00315.11
7.2.210.0030.00715.45
7.2.200.0060.00315.77
7.2.190.0030.00715.59
7.2.180.0060.01315.68
7.2.170.0110.00715.46
7.2.130.0070.00717.45
7.2.120.0060.00317.19
7.2.110.0000.01517.60
7.2.100.0070.00717.35
7.2.90.0040.00717.09
7.2.80.0110.00317.30
7.2.70.0060.00317.41
7.2.60.0000.01117.03
7.2.50.0100.01017.50
7.2.40.0070.00417.50
7.2.30.0040.00817.54
7.2.20.0070.00717.46
7.2.10.0070.00717.40
7.2.00.0060.00618.30
7.1.330.0060.00916.16
7.1.320.0030.00616.09
7.1.310.0040.00416.44
7.1.300.0060.00315.88
7.1.290.0070.00716.30
7.1.280.0110.00316.11
7.1.270.0070.00716.31
7.1.260.0090.00616.07
7.1.250.0090.00616.19
7.1.240.0000.00816.06
7.1.230.0070.00716.08
7.1.220.0070.00716.24
7.1.210.0030.00916.01
7.1.200.0080.00016.36
7.1.190.0050.00216.34
7.1.180.0030.01016.30
7.1.170.0040.00416.09
7.1.160.0070.00315.95
7.1.150.0030.01015.88
7.1.140.0120.00316.11
7.1.130.0060.00816.18
7.1.120.0030.00716.40
7.1.110.0040.00816.24
7.1.100.0060.00616.98
7.1.90.0000.00716.12
7.1.80.0070.00316.20
7.1.70.0050.00716.81
7.1.60.0090.00817.74
7.1.50.0030.01416.88
7.1.40.0070.00315.93
7.1.30.0100.00315.93
7.1.20.0070.00416.09
7.1.10.0000.01316.23
7.1.00.0070.04019.42
7.0.330.0000.00715.87
7.0.320.0090.00615.88
7.0.310.0000.00916.13
7.0.300.0080.00815.50
7.0.290.0050.00215.73
7.0.280.0040.00415.57
7.0.270.0030.00915.66
7.0.260.0090.00315.89
7.0.250.0030.00715.76
7.0.240.0060.00616.04
7.0.230.0120.00015.64
7.0.220.0030.00615.82
7.0.210.0100.00315.82
7.0.200.0020.00616.50
7.0.190.0090.00315.71
7.0.180.0070.00315.75
7.0.170.0030.00715.72
7.0.160.0060.00615.52
7.0.150.0030.00716.00
7.0.140.0080.03719.16
7.0.130.0070.00715.86
7.0.120.0060.00315.84
7.0.110.0000.01115.85
7.0.100.0030.00615.94
7.0.90.0000.01515.77
7.0.80.0120.00015.58
7.0.70.0000.01115.95
7.0.60.0100.04717.89
7.0.50.0050.02417.11
7.0.40.0030.04517.09
7.0.30.0070.02917.11
7.0.20.0110.04116.98
7.0.10.0050.04816.96
7.0.00.0070.03217.22
5.6.380.0040.00715.05
5.6.370.0000.00714.59
5.6.360.0000.00814.53
5.6.350.0000.00714.91
5.6.340.0060.00614.82
5.6.330.0000.01414.64
5.6.320.0060.00614.49
5.6.310.0030.01015.01
5.6.300.0000.00914.71
5.6.290.0040.01114.85
5.6.280.0020.04117.99
5.6.270.0090.00314.54
5.6.260.0070.00714.73
5.6.250.0090.00614.73
5.6.240.0000.01214.82
5.6.230.0030.00514.88
5.6.220.0000.01314.89
5.6.210.0070.03817.96
5.6.200.0080.04216.54
5.6.190.0030.02417.68
5.6.180.0100.02617.69
5.6.170.0220.03817.89
5.6.160.0100.03717.83
5.6.150.0040.04516.56
5.6.140.0100.03216.63
5.6.130.0090.04216.51
5.6.120.0140.03818.13
5.6.110.0050.04417.96
5.6.100.0080.02618.06
5.6.90.0070.04317.93
5.6.80.0030.02317.77
5.6.70.0000.01314.44
5.6.60.0060.00614.82
5.6.50.0030.01214.57
5.6.40.0060.00314.33
5.6.30.0030.00914.96
5.6.20.0000.01214.64
5.6.10.0000.01514.72
5.6.00.0130.00314.77
5.5.380.0050.00011.42
5.5.370.0060.00011.50
5.5.360.0000.01111.59
5.5.350.0100.01816.03
5.5.340.0040.02414.96
5.5.330.0060.03616.11
5.5.320.0210.03915.85
5.5.310.0120.04416.11
5.5.300.0050.03714.90
5.5.290.0060.02315.04
5.5.280.0040.04416.33
5.5.270.0090.03316.44
5.5.260.0080.03916.46
5.5.250.0080.02016.26
5.5.240.0070.03416.11
5.5.230.0090.00311.54
5.5.220.0030.00611.15
5.5.210.0040.00711.66
5.5.200.0050.00211.20
5.5.190.0060.00011.71
5.5.180.0000.01111.38
5.5.170.0070.00311.26
5.5.160.0030.00311.41
5.5.150.0060.00311.37
5.5.140.0110.00011.34
5.5.130.0000.01011.14
5.5.120.0030.00711.66
5.5.110.0040.00711.22
5.5.100.0000.00711.46
5.5.90.0050.00311.61
5.5.80.0070.00311.19
5.5.70.0090.00011.00
5.5.60.0060.00311.57
5.5.50.0000.00511.22
5.5.40.0090.00311.46
5.5.30.0030.00311.29
5.5.20.0000.00611.40
5.5.10.0000.00811.39
5.5.00.0050.00311.25
5.4.450.0180.03515.22
5.4.440.0160.03515.13
5.4.430.0150.02015.14
5.4.420.0100.02415.13
5.4.410.0130.02615.13
5.4.400.0170.02915.05
5.4.390.0120.02614.97
5.4.380.0220.03515.02
5.4.370.0200.01715.03
5.4.360.0130.03314.95
5.4.350.0170.02614.80
5.4.340.0230.03214.96
5.4.330.0000.00710.86
5.4.320.0200.03314.98
5.4.310.0170.04014.95
5.4.300.0150.02014.93
5.4.290.0150.02714.92
5.4.280.0170.03114.82
5.4.270.0170.02814.93
5.4.260.0140.02115.02
5.4.250.0120.02714.87
5.4.240.0200.02315.07
5.4.230.0170.02714.90
5.4.220.0210.03315.02
5.4.210.0180.02514.70
5.4.200.0150.02715.00
5.4.190.0170.02415.04
5.4.180.0200.03514.80
5.4.170.0180.03514.75
5.4.160.0210.03514.86
5.4.150.0170.02214.97
5.4.140.0180.02313.52
5.4.130.0290.02513.79
5.4.120.0130.02713.52
5.4.110.0200.02013.67
5.4.100.0120.02013.64
5.4.90.0210.03113.64
5.4.80.0150.03613.61
5.4.70.0150.03413.71
5.4.60.0140.03313.62
5.4.50.0130.02213.62
5.4.40.0130.02313.72
5.4.30.0120.02313.40
5.4.20.0130.02113.64
5.4.10.0140.02413.74
5.4.00.0160.03113.43
5.3.290.0160.04312.42
5.3.280.0210.01512.42
5.3.270.0150.02712.53
5.3.260.0160.04012.37
5.3.250.0180.03812.50
5.3.240.0170.03212.31
5.3.230.0130.02512.43
5.3.220.0200.03212.41
5.3.210.0210.02912.45
5.3.200.0180.02712.50
5.3.190.0120.03812.38
5.3.180.0120.03012.57
5.3.170.0080.02412.57
5.3.160.0160.02012.50
5.3.150.0150.03712.49
5.3.140.0170.02112.46
5.3.130.0060.02812.60
5.3.120.0170.02212.48
5.3.110.0150.03812.47
5.3.100.0120.04112.16
5.3.90.0150.03512.24
5.3.80.0190.03012.21
5.3.70.0190.02012.27
5.3.60.0080.02612.13
5.3.50.0190.03312.12
5.3.40.0210.03612.15
5.3.30.0150.03611.99
5.3.20.0110.02311.94
5.3.10.0150.03911.90
5.3.00.0220.02911.87
5.2.170.0140.02810.85
5.2.160.0130.02010.85
5.2.150.0100.02310.85
5.2.140.0130.02510.85
5.2.130.0140.03210.85
5.2.120.0170.02710.85
5.2.110.0100.02810.85
5.2.100.0170.02710.85
5.2.90.0140.02610.85
5.2.80.0170.03010.85
5.2.70.0110.02610.85
5.2.60.0120.02810.85
5.2.50.0100.02610.85
5.2.40.0150.03010.85
5.2.30.0150.02710.85
5.2.20.0080.02010.85
5.2.10.0070.02710.85
5.2.00.0080.02310.85
5.1.60.0120.02610.85
5.1.50.0100.01910.85
5.1.40.0110.01510.85
5.1.30.0140.01010.85
5.1.20.0100.01610.85
5.1.10.0110.02210.85
5.1.00.0130.01210.85
5.0.50.0070.01310.85
5.0.40.0070.01210.85
5.0.30.0070.03010.85
5.0.20.0070.01410.85
5.0.10.0060.02110.85
5.0.00.0040.03210.85
4.4.90.0080.01610.85
4.4.80.0070.01910.85
4.4.70.0070.00910.85
4.4.60.0030.01110.85
4.4.50.0050.00910.85
4.4.40.0030.02710.85
4.4.30.0080.00610.85
4.4.20.0100.00510.85
4.4.10.0060.01010.85
4.4.00.0050.01510.85
4.3.110.0050.01210.85
4.3.100.0050.01210.85
4.3.90.0040.00910.85
4.3.80.0030.01710.85
4.3.70.0080.01810.85
4.3.60.0050.01810.85
4.3.50.0080.01010.85
4.3.40.0050.01810.85
4.3.30.0050.00810.85
4.3.20.0030.01010.85
4.3.10.0000.01210.85
4.3.00.0030.02010.85

preferences:
47.68 ms | 400 KiB | 5 Q