3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * convertBytes * * Convert bytes into human readable form with rounding * * @name convertBytes * @access public * @param integer $bytes * @param integer $decimals = 2 * @desc Convert bytes into human readable form with rounding * @return string */ function convertBytes($bytes, $decimals = 2) { $suffixes = 'BKMGTP'; $factor = floor((strlen($bytes) - 1) / 3); return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$suffixes[$factor]; } echo convertBytes(1500)."\n"; echo convertBytes(1500*1000)."\n"; echo convertBytes(1500*1000*1000)."\n"; echo convertBytes(1500*1000*1000*1000)."\n"; echo convertBytes(1500*1000*1000*1000*1000)."\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.0180.00318.65
8.3.50.0050.01116.90
8.3.40.0120.00318.93
8.3.30.0070.00718.88
8.3.20.0040.00421.05
8.3.10.0040.00419.35
8.3.00.0080.00022.12
8.2.180.0090.00625.92
8.2.170.0120.00322.96
8.2.160.0100.00320.77
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0070.00026.16
8.2.110.0030.00622.33
8.2.100.0100.00318.28
8.2.90.0050.00319.42
8.2.80.0080.00017.97
8.2.70.0070.00417.63
8.2.60.0060.00318.18
8.2.50.0030.01018.07
8.2.40.0040.00418.28
8.2.30.0080.00018.48
8.2.20.0000.00718.24
8.2.10.0040.00419.20
8.2.00.0000.00719.78
8.1.280.0110.00425.92
8.1.270.0030.00721.13
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0100.00024.05
8.1.230.0070.00417.89
8.1.220.0060.00318.03
8.1.210.0000.00918.77
8.1.200.0060.00317.36
8.1.190.0080.00317.47
8.1.180.0000.00818.10
8.1.170.0000.00818.89
8.1.160.0070.00019.12
8.1.150.0040.00419.06
8.1.140.0050.00319.07
8.1.130.0000.00720.24
8.1.120.0000.00817.60
8.1.110.0000.00717.62
8.1.100.0000.00817.69
8.1.90.0030.00617.70
8.1.80.0040.00417.59
8.1.70.0000.00717.63
8.1.60.0040.00417.85
8.1.50.0030.00617.71
8.1.40.0040.00417.79
8.1.30.0030.00517.79
8.1.20.0000.00817.98
8.1.10.0040.00417.83
8.1.00.0040.00417.74
8.0.300.0040.00418.77
8.0.290.0050.00217.00
8.0.280.0070.00018.55
8.0.270.0030.00317.12
8.0.260.0030.00318.66
8.0.250.0000.00717.28
8.0.240.0000.00717.25
8.0.230.0080.00017.27
8.0.220.0000.00717.13
8.0.210.0030.00417.20
8.0.200.0030.00317.11
8.0.190.0070.00017.28
8.0.180.0040.00417.21
8.0.170.0000.00817.18
8.0.160.0040.00417.25
8.0.150.0000.00717.24
8.0.140.0030.00317.16
8.0.130.0080.00013.63
8.0.120.0040.00417.23
8.0.110.0050.00216.98
8.0.100.0030.00517.18
8.0.90.0000.00817.24
8.0.80.0070.00717.14
8.0.70.0070.00017.18
8.0.60.0000.00717.24
8.0.50.0080.00017.26
8.0.30.0140.01317.39
8.0.20.0090.00917.20
8.0.10.0070.00017.26
8.0.00.0140.00516.91
7.4.330.0000.00615.55
7.4.320.0070.00016.85
7.4.300.0030.00316.85
7.4.290.0080.00016.81
7.4.280.0040.00416.73
7.4.270.0000.00816.70
7.4.260.0000.00716.73
7.4.250.0030.00316.82
7.4.240.0080.00016.80
7.4.230.0000.00816.75
7.4.220.0000.00816.85
7.4.210.0090.00616.80
7.4.200.0040.00416.71
7.4.160.0100.00816.68
7.4.140.0000.01717.86
7.4.130.0070.01116.82
7.4.120.0120.01216.74
7.4.110.0170.00716.74
7.4.100.0130.00316.70
7.4.90.0090.00816.62
7.4.80.0090.00919.39
7.4.70.0090.01216.56
7.4.60.0110.01316.58
7.4.50.0060.00916.64
7.4.40.0120.00616.62
7.4.00.0100.00715.39
7.3.330.0050.00013.36
7.3.320.0000.00513.64
7.3.310.0030.00616.49
7.3.300.0050.00316.60
7.3.290.0030.01016.49
7.3.280.0090.00816.45
7.3.260.0110.00716.62
7.3.240.0060.01216.52
7.3.230.0180.00316.80
7.3.210.0100.00716.73
7.3.200.0110.00716.54
7.3.190.0080.00816.66
7.3.180.0050.01316.44
7.3.170.0070.01016.66
7.3.160.0040.01416.61
7.3.50.0060.00614.95
7.3.40.0030.00914.67
7.3.30.0130.00714.69
7.3.20.0130.00016.73
7.3.10.0100.00316.82
7.3.00.0100.00316.86
7.2.330.0140.00316.59
7.2.320.0060.01216.79
7.2.310.0060.01017.04
7.2.300.0110.00816.58
7.2.290.0110.00716.60
7.2.180.0110.00015.26
7.2.170.0100.00315.27
7.2.160.0030.01414.83
7.2.150.0030.01017.06
7.2.140.0100.01317.11
7.2.130.0100.00017.09
7.2.120.0000.01016.87
7.2.110.0040.01516.94
7.2.100.0060.00917.12
7.2.90.0060.01216.96
7.2.80.0060.00617.02
7.2.70.0060.00716.88
7.2.60.0140.00016.79
7.2.50.0110.00316.95
7.2.40.0100.00316.99
7.2.30.0100.00316.82
7.2.20.0120.00317.02
7.2.10.0030.01017.28
7.2.00.0070.00716.78
7.1.280.0070.00716.02
7.1.270.0030.01016.05
7.1.260.0090.00315.89
7.1.250.0000.00915.94

preferences:
67.51 ms | 401 KiB | 5 Q