3v4l.org

run code in 300+ PHP versions simultaneously
<?php const THRESHOLD_PRICES = [ 2 => 8.23, 5 => 10.97, 10 => 13.28, 15 => 15.40, 20 => 18.15, 25 => 20.36, 30 => 22.84, 40 => 25.60, 50 => 28.35, 60 => 31.89, 70 => 36.23, 80 => 39.40, 90 => 42.52, 100 => 44.75 ]; function getThresholdPrice(int $search): float { if (isset(THRESHOLD_PRICES[$search])) { return THRESHOLD_PRICES[$search]; } foreach (THRESHOLD_PRICES as $threshold => $price) { if ($threshold > $search) { break; } } return $price; } foreach (range(1, 105, 13) as $test) { printf("%d => %.02f\n", $test, getThresholdPrice($test)); }

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.4.130.0130.00617.78
8.4.120.0060.00320.85
8.4.110.0130.00918.57
8.4.100.0130.00917.44
8.4.90.0080.01217.72
8.4.80.0060.00318.91
8.4.70.0110.00918.20
8.4.60.0100.01118.84
8.4.50.0050.00420.34
8.4.40.0130.00720.53
8.4.30.0160.00320.21
8.4.20.0160.00420.64
8.4.10.0080.00024.29
8.3.260.0050.00416.77
8.3.250.0110.00718.84
8.3.240.0110.00916.40
8.3.230.0140.00816.59
8.3.220.0040.00319.08
8.3.210.0060.00816.53
8.3.200.0080.00116.80
8.3.190.0050.00317.10
8.3.180.0080.00918.33
8.3.170.0090.00920.75
8.3.160.0110.00716.96
8.3.150.0090.00916.92
8.3.140.0060.01218.30
8.3.130.0060.00316.66
8.3.120.0100.00720.65
8.3.110.0090.00018.46
8.3.100.0080.00016.62
8.3.90.0080.00026.77
8.3.80.0060.00318.56
8.3.70.0100.00716.58
8.3.60.0040.01516.48
8.3.50.0170.00320.09
8.3.40.0000.01419.23
8.3.30.0150.00018.96
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0140.00620.68
8.2.280.0060.00218.29
8.2.270.0070.01119.07
8.2.260.0080.00816.50
8.2.250.0050.00316.48
8.2.240.0130.00617.21
8.2.230.0050.00520.94
8.2.220.0110.00024.06
8.2.210.0040.00426.77
8.2.200.0060.00316.50
8.2.190.0120.00916.63
8.2.180.0150.00725.92
8.2.170.0110.00418.77
8.2.160.0080.00622.96
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.14
8.2.110.0000.01122.25
8.2.100.0060.00617.59
8.2.90.0080.00019.26
8.2.80.0080.00018.04
8.2.70.0050.00317.50
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0030.00618.16
8.2.30.0070.00018.04
8.2.20.0000.00720.48
8.2.10.0040.00418.13
8.2.00.0060.00319.32
8.1.330.0110.00718.36
8.1.320.0110.00816.00
8.1.310.0120.00316.75
8.1.300.0120.00316.84
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0130.00323.99
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00622.45
8.1.230.0000.01120.97
8.1.220.0030.00517.78
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0060.00317.10
8.1.180.0060.00318.10
8.1.170.0080.00418.26
8.1.160.0030.00518.90
8.1.150.0000.00718.71
8.1.140.0050.00317.46
8.1.130.0000.00718.93
8.1.120.0000.00717.49
8.1.110.0040.00417.38
8.1.100.0000.00717.51
8.1.90.0030.00617.48
8.1.80.0030.00617.40
8.1.70.0000.00717.49
8.1.60.0040.00417.63
8.1.50.0060.00317.03
8.1.40.0150.01217.51
8.1.30.0210.00417.66
8.1.20.0200.00617.48
8.1.10.0200.00717.48
8.1.00.0210.00317.35
8.0.300.0000.00918.77
8.0.290.0040.00416.63
8.0.280.0040.00420.15
8.0.270.0000.00718.05
8.0.260.0000.00718.43
8.0.250.0000.00716.93
8.0.240.0000.00816.86
8.0.230.0000.00716.92
8.0.220.0030.00316.77
8.0.210.0070.00016.77
8.0.200.0000.00716.85
8.0.190.0030.00616.91
8.0.180.0040.00416.96
8.0.170.0000.00916.89
8.0.160.0110.00316.74
8.0.150.0100.00016.85
8.0.140.0000.01116.84
8.0.130.0090.00616.95
8.0.120.0070.00716.79
8.0.110.0120.00616.78
8.0.100.0130.00716.86
8.0.90.0100.00316.71
8.0.80.0160.00516.86
8.0.70.0180.00316.82
8.0.60.0150.00816.89
8.0.50.0170.00616.89
8.0.30.0230.00016.79
8.0.20.0130.00716.79
8.0.10.0130.00816.95
7.4.330.0020.00315.55
7.4.320.0030.00316.48
7.4.300.0030.00316.62
7.4.290.0200.00216.62
7.4.280.0140.00716.48
7.4.270.0070.01016.48
7.4.260.0230.00316.57
7.4.250.0170.00816.50
7.4.240.0160.00516.43
7.4.230.0190.00416.45
7.4.220.0200.00016.46
7.4.210.0180.00416.59
7.4.200.0210.00016.48
7.4.190.0110.01116.62
7.4.180.0160.00516.55
7.4.160.0080.00316.55
7.4.150.0150.00316.50
7.4.140.0040.01216.51
7.4.130.0120.00016.46
7.4.120.0090.00316.50
7.4.110.0090.00416.46
7.4.100.0210.00016.58
7.4.90.0160.00616.43
7.4.80.0160.00016.36
7.4.70.0150.00416.35
7.4.60.0090.00516.36
7.4.50.0100.00316.40
7.4.40.0080.00516.37
7.4.30.0120.00016.30
7.4.20.0160.00416.48
7.4.10.0120.00416.43
7.4.00.0110.00516.37

preferences:
28.39 ms | 403 KiB | 5 Q