3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roundToValues( $search, array $arr ) { foreach( $arr as $item) { echo "i:$item s:$search\n"; if($item<$search){echo "true\n";} } } $arr = [ '0' => '0', '20' => '0-20', '50' => '20-50', '100' => '50-100', '200' => '100-200', '500' => '200-500' ]; var_dump( roundToValues('49.99',$arr) ); ?>

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.0070.00718.03
8.3.50.0090.01022.04
8.3.40.0150.00018.54
8.3.30.0040.01118.68
8.3.20.0030.00520.29
8.3.10.0040.00421.87
8.3.00.0000.00817.68
8.2.180.0130.00916.38
8.2.170.0140.00722.96
8.2.160.0140.00720.36
8.2.150.0040.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00420.89
8.2.110.0050.00522.08
8.2.100.0040.00718.16
8.2.90.0040.00419.02
8.2.80.0030.00617.97
8.2.70.0080.00017.63
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0050.00320.01
8.2.30.0060.00318.06
8.2.20.0040.00417.68
8.2.10.0030.00517.98
8.2.00.0000.00817.67
8.1.280.0110.00425.92
8.1.270.0030.00522.19
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0000.01119.00
8.1.220.0090.00017.74
8.1.210.0000.00818.77
8.1.200.0040.00417.38
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00418.62
8.1.160.0000.00722.01
8.1.150.0030.00518.95
8.1.140.0000.00817.41
8.1.130.0030.00317.82
8.1.120.0000.00717.35
8.1.110.0040.00417.42
8.1.100.0030.00517.33
8.1.90.0040.00417.45
8.1.80.0030.00517.37
8.1.70.0000.00717.41
8.1.60.0040.00417.59
8.1.50.0050.00317.52
8.1.40.0040.00417.50
8.1.30.0040.00417.50
8.1.20.0040.00417.60
8.1.10.0000.00817.48
8.1.00.0040.00417.32
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0040.00417.17
8.0.260.0000.00617.25
8.0.250.0000.00716.98
8.0.240.0070.00016.82
8.0.230.0040.00416.89
8.0.220.0000.00616.92
8.0.210.0030.00316.89
8.0.200.0000.00716.97
8.0.190.0080.00016.91
8.0.180.0000.00816.81
8.0.170.0000.00716.98
8.0.160.0000.00716.95
8.0.150.0000.00716.73
8.0.140.0040.00416.79
8.0.130.0000.00613.29
8.0.120.0040.00416.86
8.0.110.0040.00416.85
8.0.100.0050.00316.84
8.0.90.0030.00516.72
8.0.80.0030.01216.83
8.0.70.0000.00716.88
8.0.60.0050.00216.73
8.0.50.0000.00816.71
8.0.30.0160.00317.04
8.0.20.0130.00817.41
8.0.10.0040.00317.07
8.0.00.0080.01316.85
7.4.330.0050.00015.20
7.4.320.0030.00316.52
7.4.300.0000.00616.51
7.4.290.0070.00016.41
7.4.280.0000.00816.39
7.4.270.0080.00016.50
7.4.260.0000.00916.50
7.4.250.0040.00416.38
7.4.240.0030.00416.58
7.4.230.0040.00416.41
7.4.220.0060.01316.44
7.4.210.0090.00616.70
7.4.200.0080.00016.53
7.4.160.0080.00816.50
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0070.01016.56
7.4.120.0110.00616.56
7.4.110.0110.00716.42
7.4.100.0130.00416.47
7.4.90.0080.00916.44
7.4.80.0080.00819.39
7.4.70.0150.00016.61
7.4.60.0140.00716.38
7.4.50.0030.00616.53
7.4.40.0130.00616.68
7.4.30.0060.01016.49
7.4.00.0110.00414.81
7.3.330.0060.00013.31
7.3.320.0050.00013.21
7.3.310.0000.00616.46
7.3.300.0070.00016.32
7.3.290.0070.00716.29
7.3.280.0110.00716.37
7.3.270.0030.01317.40
7.3.260.0080.00916.37
7.3.250.0150.00816.47
7.3.240.0130.00316.61
7.3.230.0080.00816.60
7.3.210.0070.01316.57
7.3.200.0090.00619.39
7.3.190.0160.00316.36
7.3.180.0030.01316.48
7.3.170.0100.01316.45
7.3.160.0110.00416.69
7.3.120.0070.00715.00
7.3.10.0090.00316.38
7.3.00.0070.00416.36
7.2.330.0120.00616.77
7.2.320.0140.00716.75
7.2.310.0110.00716.37
7.2.300.0060.01116.37
7.2.290.0090.00616.53
7.2.130.0030.01016.46
7.2.120.0090.00316.59
7.2.110.0160.00616.38
7.2.100.0150.00716.45
7.2.90.0120.01216.37
7.2.80.0110.01716.74
7.2.70.0090.01116.86
7.2.60.0180.00716.66
7.2.50.0190.00216.75
7.2.40.0140.01116.91
7.2.30.0140.01216.57
7.2.20.0090.00916.71
7.2.10.0130.00916.54
7.2.00.0090.00918.25
7.1.250.0140.00415.39
7.1.100.0000.01118.20
7.1.70.0030.00317.18
7.1.60.0170.00719.25
7.1.50.0100.01016.98
7.1.00.0100.06722.30
7.0.200.0000.00716.71
7.0.140.0030.07321.95
7.0.60.0030.08019.93
7.0.50.0100.07317.97
7.0.40.0070.05320.09
7.0.30.0200.05720.16
7.0.20.0330.06720.09
7.0.10.0100.08320.33
7.0.00.0070.06020.25
5.6.280.0030.07321.08
5.6.210.0070.06320.51
5.6.200.0070.07718.19
5.6.190.0070.06020.34
5.6.180.4070.04020.77
5.6.170.0270.05320.56
5.6.160.0070.05720.50
5.6.150.0030.05718.27
5.6.140.0100.03718.18
5.6.130.0070.03718.15
5.6.120.0100.07721.00
5.6.110.0100.05721.20
5.6.100.0170.07320.96
5.6.90.0230.07321.00
5.6.80.0030.08320.41
5.6.70.4400.04020.28
5.5.350.0070.08320.34
5.5.340.0030.06317.94
5.5.330.0030.04320.31
5.5.320.3070.04020.25
5.5.310.0200.07020.28
5.5.300.0170.05718.08
5.5.290.0070.08317.98
5.5.280.0130.06720.80
5.5.270.0030.07320.77
5.5.260.0200.07020.65
5.5.250.0070.03720.71
5.5.240.0330.07020.07
5.4.450.0130.04319.52
5.4.440.0170.03719.47
5.4.430.0200.04319.47
5.4.420.0230.03319.19
5.4.410.0100.04019.42
5.4.400.0200.04019.07
5.4.390.0170.05018.95
5.4.380.0170.03719.31
5.4.370.0170.03719.16
5.4.360.0170.03719.10
5.4.350.0270.06719.15
5.4.340.0170.08019.23
5.4.320.0300.07719.24
5.4.310.0170.06718.88
5.4.300.0230.03319.22
5.4.290.0230.03318.87
5.4.280.0230.07019.31
5.4.270.0270.03719.14
5.4.260.0230.07719.15
5.4.250.0270.03319.23
5.4.240.0270.07319.19
5.4.230.0270.06719.16
5.4.220.0370.07318.81
5.4.210.0270.04319.15
5.4.200.0230.06719.15
5.4.190.0100.04719.23
5.4.180.0300.04019.14
5.4.170.0230.07319.20
5.4.160.0170.04319.28
5.4.150.0200.04319.13
5.4.140.0270.03316.47
5.4.130.0300.06716.66
5.4.120.0130.05016.51
5.4.110.0300.06316.56
5.4.100.0200.04316.50
5.4.90.0200.06716.55
5.4.80.0300.04316.50
5.4.70.0170.04716.35
5.4.60.0230.06316.48
5.4.50.0300.07016.43
5.4.40.0330.06316.55
5.4.30.0230.05716.24
5.4.20.0200.04016.23
5.4.10.0270.07016.35
5.4.00.0230.04015.75
5.3.290.0170.07314.57
5.3.280.0270.06714.62
5.3.270.0270.04314.50
5.3.260.0270.07014.50
5.3.250.0200.04014.53
5.3.240.0300.06314.58
5.3.230.0270.03714.76
5.3.220.0270.06314.57
5.3.210.0200.07314.47
5.3.200.0230.05014.68
5.3.190.0200.07714.54
5.3.180.0230.07014.48
5.3.170.0230.03714.57
5.3.160.0230.04314.53
5.3.150.0300.05714.61
5.3.140.0170.06014.55
5.3.130.0330.04714.55
5.3.120.0370.03314.52
5.3.110.0200.07714.59
5.3.100.0130.04714.09
5.3.90.0330.06314.02
5.3.80.0200.06014.03
5.3.70.0230.04313.92
5.3.60.0200.04313.91
5.3.50.0200.03714.11
5.3.40.0230.05013.95
5.3.30.0270.06714.02
5.3.20.0230.07013.60
5.3.10.0370.04013.56
5.3.00.0270.06713.55
5.2.170.0330.05012.41
5.2.160.0200.05312.41
5.2.150.0230.06012.41
5.2.140.0130.06712.41
5.2.130.0200.06012.41
5.2.120.0130.05312.41
5.2.110.0270.05312.41
5.2.100.0300.05012.41
5.2.90.0230.05712.41
5.2.80.0200.03312.41
5.2.70.0230.06012.41
5.2.60.0200.06012.41
5.2.50.0230.05012.41
5.2.40.0130.04712.41
5.2.30.0230.03312.41
5.2.20.0170.03312.41
5.2.10.0200.04312.41
5.2.00.0170.03712.41
5.1.60.0170.05012.41
5.1.50.0200.02712.41
5.1.40.0170.03012.41
5.1.30.0200.05012.41
5.1.20.0170.05312.41
5.1.10.0170.05312.41
5.1.00.0130.02312.41
5.0.50.0070.05012.41
5.0.40.0100.04312.41
5.0.30.0100.06312.41
5.0.20.0030.03312.41
5.0.10.0100.02312.41
5.0.00.0100.06312.41
4.4.90.0070.02312.41
4.4.80.0100.03312.41
4.4.70.0100.03712.41
4.4.60.0070.03712.41
4.4.50.0130.03012.41
4.4.40.0130.03712.41
4.4.30.0070.04012.41
4.4.20.0100.02012.41
4.4.10.0070.02312.41
4.4.00.0130.05012.41
4.3.110.0130.03012.41
4.3.100.0130.03012.41
4.3.90.0100.02012.41
4.3.80.0070.03312.41
4.3.70.0100.03012.41
4.3.60.0130.03012.41
4.3.50.0070.02712.41
4.3.40.0070.05312.41
4.3.30.0100.02012.41
4.3.20.0100.03312.41
4.3.10.0030.03312.41
4.3.00.0030.02312.41

preferences:
41.22 ms | 401 KiB | 5 Q