3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roundToValues( $tax, array $possibleTaxes ) { $differences = array(); foreach( $possibleTaxes as $possibleTax) { $differences[ $possibleTax ] = abs($possibleTax - $tax); } return array_search(min($differences), $differences); } $possibleTaxes = array( '0' => '0', '20' => '0-20', '50' => '20-50', '100' => '50-100', '200' => '100-200', '500' => '200-500', ); var_dump( roundToValues(295,$possibleTaxes) ); ?>

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.0110.00818.55
8.3.50.0140.00017.93
8.3.40.0150.00018.57
8.3.30.0090.00618.87
8.3.20.0040.00420.38
8.3.10.0080.00021.95
8.3.00.0080.00019.56
8.2.180.0100.00625.92
8.2.170.0060.00922.96
8.2.160.0130.00320.11
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0080.00020.86
8.2.110.0060.00322.08
8.2.100.0080.00421.01
8.2.90.0000.00719.21
8.2.80.0060.00317.97
8.2.70.0040.00417.75
8.2.60.0040.00818.16
8.2.50.0030.00618.07
8.2.40.0030.00618.28
8.2.30.0000.00918.14
8.2.20.0040.00417.82
8.2.10.0040.00418.01
8.2.00.0000.00717.69
8.1.270.0060.00321.84
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00324.02
8.1.230.0000.01119.21
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0100.00017.36
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0030.00518.48
8.1.160.0040.00421.94
8.1.150.0040.00418.89
8.1.140.0040.00417.37
8.1.130.0030.00517.81
8.1.120.0030.00517.50
8.1.110.0030.00617.48
8.1.100.0040.00417.43
8.1.90.0000.00717.32
8.1.80.0040.00417.49
8.1.70.0000.00717.38
8.1.60.0000.00817.59
8.1.50.0080.00017.53
8.1.40.0000.00717.41
8.1.30.0080.00017.56
8.1.20.0000.00817.55
8.1.10.0040.00417.38
8.1.00.0000.00817.42
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0070.00018.45
8.0.270.0040.00417.26
8.0.260.0060.00317.28
8.0.250.0000.00716.96
8.0.240.0030.00317.09
8.0.230.0040.00416.91
8.0.220.0000.00716.99
8.0.210.0030.00516.82
8.0.200.0030.00317.02
8.0.190.0000.00716.91
8.0.180.0000.00816.88
8.0.170.0000.00916.95
8.0.160.0000.00717.04
8.0.150.0040.00316.84
8.0.140.0070.00316.92
8.0.130.0000.00513.41
8.0.120.0000.00716.98
8.0.110.0040.00416.80
8.0.100.0040.00417.02
8.0.90.0040.00417.00
8.0.80.0040.01117.03
8.0.70.0080.00016.86
8.0.60.0000.00716.95
8.0.50.0070.00016.81
8.0.30.0080.01417.09
8.0.20.0100.00917.40
8.0.10.0070.00016.96
8.0.00.0080.01016.71
7.4.330.0050.00015.00
7.4.320.0000.00616.53
7.4.300.0030.00316.60
7.4.290.0070.00016.52
7.4.280.0080.00016.48
7.4.270.0000.00716.65
7.4.260.0020.00516.45
7.4.250.0000.00716.38
7.4.240.0040.00316.58
7.4.230.0030.00316.41
7.4.220.0130.00716.62
7.4.210.0120.00916.51
7.4.200.0040.00416.70
7.4.160.0070.00716.44
7.4.150.0080.01217.40
7.4.140.0060.01217.86
7.4.130.0100.00616.54
7.4.120.0120.01016.52
7.4.110.0130.00716.62
7.4.100.0100.01416.60
7.4.90.0100.00716.55
7.4.80.0040.01419.39
7.4.70.0070.01016.63
7.4.60.0140.00416.70
7.4.50.0000.00616.64
7.4.40.0030.01416.47
7.4.30.0030.01416.45
7.4.00.0120.00514.86
7.3.330.0030.00213.43
7.3.320.0020.00213.30
7.3.310.0060.00016.44
7.3.300.0030.00316.48
7.3.290.0070.01016.46
7.3.280.0110.00716.41
7.3.270.0150.00317.40
7.3.260.0150.00316.42
7.3.250.0090.00916.47
7.3.240.0030.01416.63
7.3.230.0090.00616.40
7.3.210.0150.00316.45
7.3.200.0090.01519.39
7.3.190.0100.00616.45
7.3.180.0110.00716.68
7.3.170.0110.00616.55
7.3.160.0120.00516.38
7.3.120.0050.01114.87
7.3.110.0130.00314.77
7.3.100.0080.00814.92
7.3.90.0100.00314.89
7.3.80.0070.00714.88
7.3.70.0090.00614.85
7.3.60.0060.00614.86
7.3.50.0040.00714.79
7.3.40.0040.00714.85
7.3.30.0040.00814.68
7.3.20.0070.01016.82
7.3.10.0070.00816.62
7.3.00.0020.01016.50
7.2.330.0060.01816.52
7.2.320.0060.01216.66
7.2.310.0110.00616.64
7.2.300.0100.00616.45
7.2.290.0120.00616.66
7.2.250.0070.01015.11
7.2.240.0120.00615.07
7.2.230.0030.01214.77
7.2.220.0040.01114.89
7.2.210.0030.01115.11
7.2.200.0150.00314.73
7.2.190.0030.00915.14
7.2.180.0000.01715.00
7.2.170.0000.01815.20
7.2.130.0060.00616.73
7.2.120.0110.00716.86
7.2.110.0060.00416.78
7.2.100.0130.00616.76
7.2.90.0030.01116.70
7.2.80.0060.01016.70
7.2.70.0100.00616.66
7.2.60.0090.00816.61
7.2.50.0060.01116.74
7.2.40.0110.00716.94
7.2.30.0130.00516.78
7.2.20.0070.01116.81
7.2.10.0110.00716.76
7.2.00.0050.01017.63
7.1.330.0030.01015.55
7.1.320.0090.00615.80
7.1.310.0060.00915.82
7.1.300.0030.00615.86
7.1.290.0090.00315.57
7.1.280.0030.01615.45
7.1.270.0020.01215.64
7.1.260.0030.01216.02
7.1.250.0050.00815.57
7.1.200.0000.00815.82
7.1.100.0000.01118.26
7.1.70.0030.00617.08
7.1.60.0100.01419.25
7.1.50.0270.00734.76
7.1.00.0000.08022.36
7.0.200.0030.00716.47
7.0.140.0100.07022.09
7.0.60.0030.09319.90
7.0.50.0130.07317.85
7.0.40.0030.08320.13
7.0.30.0170.07320.26
7.0.20.0370.07320.09
7.0.10.0130.08320.24
7.0.00.0000.06020.16
5.6.280.0030.06720.82
5.6.210.0030.08320.56
5.6.200.0070.03718.13
5.6.190.0130.08320.48
5.6.180.0170.04320.47
5.6.170.0230.04320.62
5.6.160.0030.04020.55
5.6.150.0170.02718.21
5.6.140.0230.05318.15
5.6.130.0070.08018.15
5.6.120.0030.05020.99
5.6.110.0100.08321.14
5.6.100.0000.06721.05
5.6.90.0130.07720.95
5.6.80.0100.07720.38
5.5.350.0200.07020.37
5.5.340.0200.05717.98
5.5.330.0030.04320.27
5.5.320.0470.06720.20
5.5.310.0200.06320.36
5.5.300.0100.08018.01
5.5.290.0000.05018.08
5.5.280.0070.08720.97
5.5.270.0070.04020.77
5.5.260.0170.06320.87
5.5.250.0170.07020.69
5.5.240.0330.06320.15
5.4.450.0270.03719.32
5.4.440.0070.05019.52
5.4.430.0270.04319.19
5.4.420.0130.05019.19
5.4.410.0300.04019.34
5.4.400.0270.04019.27
5.4.390.0270.04719.13
5.4.380.0170.05318.68
5.4.370.0300.03718.47
5.4.360.0130.05018.55
5.4.350.0100.06018.64
5.4.340.0170.05018.73
5.4.320.0050.03612.51
5.4.310.0080.03812.50
5.4.300.0070.03612.50
5.4.290.0070.03912.50
5.4.280.0060.03512.40
5.4.270.0060.03512.40
5.4.260.0070.03712.40
5.4.250.0040.04012.40
5.4.240.0040.03812.39
5.4.230.0050.03812.39
5.4.220.0070.03412.39
5.4.210.0060.03512.39
5.4.200.0070.03812.39
5.4.190.0080.03312.39
5.4.180.0050.03712.39
5.4.170.0090.03412.40
5.4.160.0040.03812.39
5.4.150.0080.03412.39
5.4.140.0110.03712.07
5.4.130.0080.03612.05
5.4.120.0030.03812.02
5.4.110.0060.03712.02
5.4.100.0060.04012.01
5.4.90.0050.03812.01
5.4.80.0060.04912.01
5.4.70.0050.05012.01
5.4.60.0020.03912.01
5.4.50.0080.03312.01
5.4.40.0080.03211.99
5.4.30.0080.03411.99
5.4.20.0070.03411.99
5.4.10.0060.03512.00
5.4.00.0070.03411.48
5.3.290.0020.04212.80
5.3.280.0060.03812.71
5.3.270.0050.04012.72
5.3.260.0070.03912.72
5.3.250.0050.03912.72
5.3.240.0060.03712.72
5.3.230.0080.03812.71
5.3.220.0040.04012.68
5.3.210.0120.04112.68
5.3.200.0070.03612.68
5.3.190.0080.04312.68
5.3.180.0100.03512.68
5.3.170.0060.04212.67
5.3.160.0060.04312.67
5.3.150.0060.03912.68
5.3.140.0080.03512.66
5.3.130.0030.04212.66
5.3.120.0100.03812.65
5.3.110.0040.04012.66
5.3.100.0120.03512.12
5.3.90.0090.04112.10
5.3.80.0080.04112.09
5.3.70.0100.03612.09
5.3.60.0100.04112.08
5.3.50.0090.04112.02
5.3.40.0050.03912.02
5.3.30.0130.04411.98
5.3.20.0080.03611.76
5.3.10.0090.03311.73
5.3.00.0090.04011.72
5.2.170.0070.0289.21
5.2.160.0070.0399.22
5.2.150.0080.0399.22
5.2.140.0040.0369.21
5.2.130.0070.0319.17
5.2.120.0070.0269.18
5.2.110.0030.0339.18
5.2.100.0080.0299.17
5.2.90.0050.0319.17
5.2.80.0070.0349.17
5.2.70.0060.0329.17
5.2.60.0050.0359.13
5.2.50.0040.0359.10
5.2.40.0060.0349.07
5.2.30.0080.0329.05
5.2.20.0090.0319.04
5.2.10.0080.0508.94
5.2.00.0070.0338.80
5.1.60.0090.0328.09
5.1.50.0070.0318.08
5.1.40.0040.0278.06
5.1.30.0050.0278.41
5.1.20.0070.0268.43
5.1.10.0060.0308.16
5.1.00.0050.0268.16
5.0.50.0020.0226.64
5.0.40.0060.0176.49
5.0.30.0040.0326.31
5.0.20.0020.0216.29
5.0.10.0050.0196.25
5.0.00.0040.0306.25
4.4.90.0050.0134.78
4.4.80.0020.0164.75
4.4.70.0040.0144.75
4.4.60.0010.0174.75
4.4.50.0020.0164.77
4.4.40.0020.0264.70
4.4.30.0050.0144.76
4.4.20.0050.0134.84
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0020.0164.67
4.3.100.0040.0164.66
4.3.90.0010.0204.64
4.3.80.0000.0274.58
4.3.70.0060.0244.63
4.3.60.0030.0164.63
4.3.50.0040.0214.62
4.3.40.0050.0304.54
4.3.30.0020.0213.30
4.3.20.0010.0203.28
4.3.10.0010.0173.24
4.3.00.0030.01715.26

preferences:
65.38 ms | 400 KiB | 5 Q