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 PHP_INT_SIZE . "\n"; 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.0100.00617.03
8.3.40.0090.00618.79
8.3.30.0120.00318.96
8.3.20.0080.00021.01
8.3.10.0080.00019.49
8.3.00.0080.00021.98
8.2.180.0170.00025.92
8.2.170.0110.00322.96
8.2.160.0070.00720.63
8.2.150.0100.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.27
8.2.110.0050.00522.50
8.2.100.0060.00618.28
8.2.90.0030.00618.28
8.2.80.0000.00818.29
8.2.70.0000.00818.18
8.2.60.0030.00618.47
8.2.50.0030.00618.10
8.2.40.0000.00819.59
8.2.30.0030.00619.60
8.2.20.0000.00718.41
8.2.10.0050.00219.09
8.2.00.0080.00021.64
8.1.280.0110.00425.92
8.1.270.0050.00323.99
8.1.260.0120.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00020.64
8.1.230.0040.00717.83
8.1.220.0050.00318.02
8.1.210.0000.00918.92
8.1.200.0070.00317.48
8.1.190.0080.00017.47
8.1.180.0080.00418.10
8.1.170.0030.00618.84
8.1.160.0020.00519.05
8.1.150.0000.00919.08
8.1.140.0050.00319.14
8.1.130.0040.00419.45
8.1.120.0000.00817.70
8.1.110.0000.00717.69
8.1.100.0070.00017.67
8.1.90.0100.00017.66
8.1.80.0000.00817.74
8.1.70.0070.00017.75
8.1.60.0060.00317.88
8.1.50.0050.00317.81
8.1.40.0030.00617.77
8.1.30.0030.00617.91
8.1.20.0040.00417.83
8.1.10.0000.00817.89
8.1.00.0040.00417.75
8.0.300.0060.00319.93
8.0.290.0040.00417.00
8.0.280.0030.00318.59
8.0.270.0040.00417.58
8.0.260.0030.00317.00
8.0.250.0030.00317.25
8.0.240.0040.00417.30
8.0.230.0000.00717.20
8.0.220.0050.00317.27
8.0.210.0000.00717.22
8.0.200.0030.00317.12
8.0.190.0000.00717.26
8.0.180.0030.00517.22
8.0.170.0000.00817.12
8.0.160.0080.00017.07
8.0.150.0040.00417.13
8.0.140.0070.00017.07
8.0.130.0000.00813.64
8.0.120.0040.00417.17
8.0.110.0000.00816.96
8.0.100.0030.00317.22
8.0.90.0070.00017.04
8.0.80.0050.01317.07
8.0.70.0040.00417.02
8.0.60.0000.00717.35
8.0.50.0080.00017.18
8.0.30.0160.00817.20
8.0.20.0090.01117.29
8.0.10.0050.00217.23
8.0.00.0090.00817.04
7.4.330.0060.00015.55
7.4.320.0060.00016.72
7.4.300.0030.00316.83
7.4.290.0000.00816.59
7.4.280.0000.00716.72
7.4.270.0000.00916.89
7.4.260.0040.00416.70
7.4.250.0000.00716.71
7.4.240.0000.00816.95
7.4.230.0030.00516.65
7.4.220.0050.00216.83
7.4.210.0070.00916.69
7.4.200.0030.00316.72
7.4.160.0090.00716.68
7.4.140.0140.01017.86
7.4.130.0060.01216.79
7.4.120.0090.00916.69
7.4.110.0090.00916.56
7.4.100.0030.01316.70
7.4.90.0030.01316.54
7.4.80.0060.01919.39
7.4.70.0110.01116.67
7.4.60.0120.01016.49
7.4.50.0110.00416.84
7.4.40.0080.00816.69
7.4.00.0030.01415.07
7.3.330.0020.00213.56
7.3.320.0000.00513.62
7.3.310.0030.00616.72
7.3.300.0000.00716.58
7.3.290.0070.00716.46
7.3.280.0360.00816.47
7.3.260.0110.00716.66
7.3.240.0110.00716.50
7.3.230.0090.00616.59
7.3.210.0110.00716.58
7.3.200.0100.00716.50
7.3.190.0030.01316.46
7.3.180.0070.01116.70
7.3.170.0080.01216.61
7.3.160.0120.00616.72
7.3.50.0160.00714.92
7.3.40.0090.00814.87
7.3.30.0050.01014.83
7.3.20.0250.00815.14
7.3.10.0070.00714.96
7.3.00.0150.00515.05
7.2.330.0030.01316.78
7.2.320.0130.01016.61
7.2.310.0060.00917.01
7.2.300.0160.00617.00
7.2.290.0060.01216.59
7.2.180.0070.00615.21
7.2.170.0090.00315.08
7.2.160.0130.00515.27
7.2.150.0110.00315.07
7.2.140.0090.01015.22
7.2.130.0060.00814.92
7.2.120.0160.00315.03
7.2.110.0130.00515.10
7.2.100.0130.00715.35
7.2.90.0120.00615.39
7.2.80.0070.00915.22
7.2.70.0160.00715.06
7.2.60.0410.00515.22
7.2.50.0100.00515.01
7.2.40.0090.00915.17
7.2.30.0040.00915.27
7.2.20.0470.00515.03
7.2.10.0100.00514.84
7.2.00.0130.00815.15
7.1.280.0180.00214.20
7.1.270.0120.01114.23
7.1.260.0110.00514.06
7.1.250.0110.00714.01
7.1.240.0280.00614.28
7.1.230.0210.00314.23
7.1.220.0140.01414.12
7.1.210.0200.00714.07
7.1.200.0140.01114.12
7.1.190.0260.00314.20
7.1.180.0110.00814.18
7.1.170.0180.00914.10
7.1.160.0210.00413.88
7.1.150.0290.00614.27
7.1.140.0170.00314.06
7.1.130.0240.01214.21
7.1.120.0120.02013.91
7.1.110.0370.00014.00
7.1.100.0250.00614.06
7.1.90.0230.00913.95
7.1.80.0200.01214.27
7.1.70.0190.00314.19
7.1.60.0830.00314.30
7.1.50.0200.01214.18
7.1.40.0300.00313.78
7.1.30.0290.00914.17
7.1.20.0230.01114.13
7.1.10.0230.01114.12
7.1.00.0190.00714.29
7.0.330.0130.00913.38
7.0.320.0320.00013.99
7.0.310.0250.00913.71
7.0.300.0260.00313.57
7.0.290.0220.01113.73
7.0.280.0260.01313.74
7.0.270.0220.01013.93
7.0.260.0230.01613.87
7.0.250.0240.01013.82
7.0.240.0210.00813.68
7.0.230.0200.00713.57
7.0.220.0290.01013.97
7.0.210.0130.01913.56
7.0.200.0260.00013.60
7.0.190.0160.00513.57
7.0.180.0220.01013.98
7.0.170.0140.01414.03
7.0.160.0150.00913.73
7.0.150.0220.00013.89
7.0.140.0270.00613.74
7.0.130.0300.01513.92
7.0.120.0260.00613.62
7.0.110.0200.01413.57
7.0.100.0150.01213.62
7.0.90.0090.01313.70
7.0.80.0070.01413.81
7.0.70.0200.01113.85
7.0.60.0200.01113.75
7.0.50.0200.01313.75
7.0.40.0160.00813.68
7.0.30.0190.00613.54
7.0.20.0130.01013.49
7.0.10.0190.00813.73
7.0.00.0970.00413.80
5.6.400.0070.01714.48
5.6.390.0140.02014.73
5.6.380.0150.01514.72
5.6.370.0230.01014.48
5.6.360.0120.01814.71
5.6.350.0150.00914.83
5.6.340.0150.01214.71
5.6.330.0170.01314.38
5.6.320.0270.00414.32
5.6.310.0150.01214.53
5.6.300.0150.00714.56
5.6.290.0100.02014.55
5.6.280.0160.01614.52
5.6.270.0150.01514.69
5.6.260.0140.02114.78
5.6.250.0240.00614.40
5.6.240.0180.00514.40
5.6.230.0170.01114.38
5.6.220.0150.01514.42
5.6.210.0190.01014.41
5.6.200.0120.01514.72
5.6.190.0140.01114.64
5.6.180.0130.00614.55
5.6.170.0070.00414.68
5.6.160.0230.01014.27
5.6.150.0090.01514.17
5.6.140.0090.01414.14
5.6.130.0130.00614.15
5.6.120.0110.01414.53
5.6.110.0190.00614.07
5.6.100.0140.00714.05
5.6.90.0040.01214.58
5.6.80.0150.01314.52
5.6.70.0150.00314.32
5.6.60.0120.00814.11
5.6.50.0110.00714.25
5.6.40.0170.01314.43
5.6.30.0210.00714.37
5.6.20.0100.00814.19
5.6.10.0080.00713.99
5.6.00.0160.00814.03
5.5.380.0090.00914.19
5.5.370.0070.01914.66
5.5.360.0210.01414.62
5.5.350.0130.01014.66
5.5.340.0130.01014.67
5.5.330.0120.00814.67
5.5.320.0060.01114.36
5.5.310.0080.00714.33
5.5.300.0160.00514.72
5.5.290.0110.01413.98
5.5.280.0080.00814.45
5.5.270.0110.01414.79
5.5.260.0090.01214.09
5.5.250.0080.00814.47
5.5.240.0130.00914.39
5.5.230.0100.00714.25
5.5.220.0080.00914.01
5.5.210.0100.01013.96
5.5.200.0090.01414.39
5.5.190.0060.00914.46
5.5.180.0130.00614.30
5.5.170.0040.01213.87
5.5.160.0140.01113.90
5.5.150.0120.00414.17
5.5.140.0170.00814.42
5.5.130.0070.00714.20
5.5.120.0070.01014.20
5.5.110.0120.00413.79
5.5.100.0040.01514.27
5.5.90.0090.01513.82
5.5.80.0070.01814.04
5.5.70.0060.01813.86
5.5.60.0130.00813.89
5.5.50.0180.00414.25
5.5.40.0030.01214.26
5.5.30.0130.01014.42
5.5.20.0230.00514.50
5.5.10.0100.00513.70
5.5.00.0040.01813.81
5.4.450.0090.00911.22
5.4.440.0130.01311.50
5.4.430.0130.00511.08
5.4.420.0100.01011.44
5.4.410.0070.00411.44
5.4.400.0070.00711.35
5.4.390.0060.00911.33
5.4.380.0100.00711.53
5.4.370.0150.00011.27
5.4.360.0070.01011.27
5.4.350.0050.00811.59
5.4.340.0110.00611.39
5.4.330.0080.01011.01
5.4.320.0110.00711.19
5.4.310.0130.00311.27
5.4.300.0110.00311.26
5.4.290.0090.00311.19
5.4.280.0000.01111.36
5.4.270.0000.01311.29
5.4.260.0120.00011.30
5.4.250.0130.00611.12
5.4.240.0100.00311.36
5.4.230.0100.00311.46
5.4.220.0080.00911.28
5.4.210.0100.00311.25
5.4.200.0060.01011.18
5.4.190.0090.00611.47
5.4.180.0120.00811.50
5.4.170.0130.00411.29
5.4.160.0120.00311.26
5.4.150.0180.00011.07
5.4.140.0100.00411.36
5.4.130.0090.00911.33
5.4.120.0080.00411.11
5.4.110.0070.00711.41
5.4.100.0140.00311.36
5.4.90.0110.00811.07
5.4.80.0090.00911.20
5.4.70.0090.00311.32
5.4.60.0150.00311.35
5.4.50.0060.01211.08
5.4.40.0140.01011.16
5.4.30.0120.00811.40
5.4.20.0070.01011.39
5.4.10.0060.00611.38
5.4.00.0170.00511.39
5.3.290.0090.00310.72
5.3.280.0000.01010.64
5.3.270.0130.00310.68
5.3.260.0100.01010.53
5.3.250.0160.00310.36
5.3.240.0120.00610.48
5.3.230.0080.01310.30
5.3.220.0170.00510.61
5.3.210.0160.00610.42
5.3.200.0100.01110.68
5.3.190.0090.00210.75
5.3.180.0100.00510.84
5.3.170.0090.00310.86
5.3.160.0110.00810.55
5.3.150.0130.00310.57
5.3.140.0070.01410.59
5.3.130.0120.00310.67
5.3.120.0150.00610.74
5.3.110.0080.01010.35
5.3.100.0140.00310.70
5.3.90.0080.01110.76
5.3.80.0070.01010.66
5.3.70.0090.00410.58
5.3.60.0150.00010.46
5.3.50.0100.00610.70
5.3.40.0200.00010.82
5.3.30.0060.00710.80
5.3.20.0120.00910.71
5.3.10.0100.00310.55
5.3.00.0130.00310.27
5.2.170.0080.0069.91
5.2.160.0130.0079.91
5.2.150.0090.0069.91
5.2.140.0070.0079.91
5.2.130.0070.0079.91
5.2.120.0080.0099.91
5.2.110.0030.0149.91
5.2.100.0100.0039.91
5.2.90.0080.0059.91
5.2.80.0060.0099.91
5.2.70.0120.0009.91
5.2.60.0040.0079.91
5.2.50.0100.0029.91
5.2.40.0090.0029.91
5.2.30.0090.0039.91
5.2.20.0090.0049.91
5.2.10.0050.0059.91
5.2.00.0130.0039.91
5.1.60.0070.0059.91
5.1.50.0090.0009.91
5.1.40.0100.0039.91
5.1.30.0070.0049.91
5.1.20.0080.0049.91
5.1.10.0090.0059.91
5.1.00.0090.0029.91
5.0.50.0110.0009.91
5.0.40.0070.0029.91
5.0.30.0080.0009.91
5.0.20.0020.0059.91
5.0.10.0030.0069.91
5.0.00.0070.0009.91
4.4.90.0040.0049.91
4.4.80.0030.0079.91
4.4.70.0050.0059.91
4.4.60.0030.0039.91
4.4.50.0040.0049.91
4.4.40.0000.0079.91
4.4.30.0000.0079.91
4.4.20.0050.0059.91
4.4.10.0030.0039.91
4.4.00.0060.0039.91
4.3.110.0070.0049.91
4.3.100.0080.0049.91
4.3.90.0070.0039.91
4.3.80.0000.0119.91
4.3.70.0000.0109.91
4.3.60.0070.0049.91
4.3.50.0100.0009.91
4.3.40.0060.0039.91
4.3.30.0000.0119.91
4.3.20.0030.0039.91
4.3.10.0100.0029.91
4.3.00.0060.0059.91

preferences:
72.01 ms | 401 KiB | 5 Q