3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tires = [ 'Desert'=>array('dry'=>10, 'wet'=>4, 'snow'=>1), 'Ocean'=>array('dry'=>6, 'wet'=>8, 'snow'=>6), 'RainForest'=>array('dry'=>6, 'wet'=>10, 'snow'=>6), 'Glacier'=>array('dry'=>4, 'wet'=>9, 'snow'=>10), 'Prairie'=>array('dry'=>7, 'wet'=>7, 'snow'=>7), ]; $minimumScore = 5; // remove tires that have a single rating less than minimum $filtered = array_filter($tires, function (array $data) use ($minimumScore) { return min($data) >= $minimumScore; }); // calculate scores as average of score per category $scores = array_map(function (array $data) { return array_sum($data) / count($data); }, $filtered); // find maximum of scores $bestScore = max($scores); // find keys with the best score $bestTires = array_keys($scores, $bestScore); // there could be more than one tire with same score, pick the first $bestTire = array_shift($bestTires); echo sprintf( '%s is the best tire with the score: %s', $bestTire, $bestScore );

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.5.30.0110.00619.55
8.5.20.0110.00918.69
8.5.10.0110.00816.73
8.5.00.0110.01219.80
8.4.180.0120.00920.29
8.4.170.0120.00920.52
8.4.160.0120.01023.88
8.4.150.0070.00516.80
8.4.140.0080.01417.52
8.4.130.0130.00719.44
8.4.120.0130.00622.41
8.4.110.0130.00622.30
8.4.100.0130.00718.86
8.4.90.0120.00918.68
8.4.80.0110.00917.56
8.4.70.0080.01117.70
8.4.60.0130.00817.61
8.4.50.0140.00617.52
8.4.40.0100.01019.40
8.4.30.0170.00719.33
8.4.20.0100.01017.38
8.4.10.0070.00319.32
8.3.300.0110.00820.62
8.3.290.0110.01020.70
8.3.280.0110.00818.33
8.3.270.0130.00616.64
8.3.260.0110.00816.50
8.3.250.0110.00818.75
8.3.240.0110.00817.23
8.3.230.0130.00616.63
8.3.220.0090.00819.11
8.3.210.0140.00816.73
8.3.200.0060.00318.89
8.3.190.0100.00816.52
8.3.180.0030.00518.25
8.3.170.0000.01816.64
8.3.160.0130.00716.63
8.3.150.0070.00317.09
8.3.140.0040.00416.45
8.3.130.0040.00418.47
8.3.120.0120.00618.75
8.3.110.0040.00420.94
8.3.100.0110.00016.66
8.3.90.0000.00816.79
8.3.80.0060.00317.97
8.3.70.0120.00318.31
8.3.60.0140.00718.43
8.3.50.0140.00518.35
8.3.40.0210.00018.69
8.3.30.0070.00718.63
8.3.20.0090.00020.38
8.3.10.0040.00420.75
8.3.00.0050.00320.95
8.2.300.0130.00722.34
8.2.290.0100.00820.45
8.2.280.0080.00318.42
8.2.270.0000.00816.35
8.2.260.0070.01120.65
8.2.250.0080.00816.70
8.2.240.0000.00818.88
8.2.230.0030.00622.58
8.2.220.0040.00424.06
8.2.210.0000.00826.77
8.2.200.0030.00616.63
8.2.190.0060.00916.58
8.2.180.0170.00317.96
8.2.170.0040.01122.96
8.2.160.0110.00420.39
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0000.00819.30
8.2.120.0040.00426.35
8.2.110.0090.00020.89
8.2.100.0070.01017.84
8.2.90.0030.00517.75
8.2.80.0030.00618.78
8.2.70.0030.00617.50
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0040.00418.10
8.2.30.0000.00817.94
8.2.20.0030.00617.99
8.2.10.0030.00618.11
8.2.00.0040.00417.98
8.1.340.0090.01117.64
8.1.330.0090.01121.95
8.1.320.0130.00916.28
8.1.310.0040.00416.67
8.1.300.0090.00616.34
8.1.290.0040.00830.84
8.1.280.0090.00625.92
8.1.270.0040.00422.05
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.00919.09
8.1.230.0040.00717.83
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.36
8.1.190.0040.00417.36
8.1.180.0040.00419.41
8.1.170.0060.00318.53
8.1.160.0070.00018.86
8.1.150.0000.00718.89
8.1.140.0040.00419.57
8.1.130.0050.00217.45
8.1.120.0000.00717.44
8.1.110.0040.00417.47
8.1.100.0070.00017.48
8.1.90.0000.00817.41
8.1.80.0050.00317.36
8.1.70.0070.00017.41
8.1.60.0040.00417.55
8.1.50.0040.00417.55
8.1.40.0030.00517.49
8.1.30.0050.00317.48
8.1.20.0050.00217.65
8.1.10.0080.00017.50
8.1.00.0000.00717.33
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.36
8.0.270.0000.00716.75
8.0.260.0030.00316.74
8.0.250.0030.00316.85
8.0.240.0060.00316.89
8.0.230.0000.00716.79
8.0.220.0070.00016.91
8.0.210.0070.00016.78
8.0.200.0000.00816.95
8.0.190.0000.00816.91
8.0.180.0040.00416.99
8.0.170.0070.00016.81
8.0.160.0030.00516.79
8.0.150.0060.00316.69
8.0.140.0000.00716.84
8.0.130.0030.00313.36
8.0.120.0050.00216.75
8.0.110.0090.00017.00
8.0.100.0070.00016.71
8.0.90.0000.00816.99
8.0.80.0070.00716.84
8.0.70.0000.00716.87
8.0.60.0000.00716.89
8.0.50.0050.00316.79
8.0.30.0110.00717.21
8.0.20.0110.00817.40
8.0.10.0070.00016.90
8.0.00.0110.00816.64
7.4.330.0020.00315.55
7.4.320.0000.00816.52
7.4.300.0000.00716.61
7.4.290.0060.00316.64
7.4.280.0050.00316.51
7.4.270.0030.00316.63
7.4.260.0040.00416.48
7.4.250.0000.00716.56
7.4.240.0000.00716.52
7.4.230.0080.00016.44
7.4.220.0130.01316.63
7.4.210.0090.00816.63
7.4.200.0000.00716.35
7.4.160.0030.01216.46
7.4.150.0180.00617.40
7.4.140.0110.00617.86
7.4.130.0060.01216.48
7.4.120.0090.00916.49
7.4.110.0030.01316.43
7.4.100.0090.01316.44
7.4.90.0040.01216.46
7.4.80.0090.01019.39
7.4.70.0170.00016.51
7.4.60.0040.01316.46
7.4.50.0100.00316.68
7.4.40.0030.01316.53
7.4.30.0090.01316.41
7.4.00.0030.01214.92
7.3.330.0000.00613.27
7.3.320.0060.00013.16
7.3.310.0000.00716.41
7.3.300.0030.00316.36
7.3.290.0000.00716.31
7.3.280.0070.00916.27
7.3.270.0080.01117.40
7.3.260.0060.01216.36
7.3.250.0100.00716.29
7.3.240.0080.00916.46
7.3.230.0110.00516.35
7.3.210.0030.01316.39
7.3.200.0040.01216.37
7.3.190.0090.00616.30
7.3.180.0080.01116.54
7.3.170.0070.01016.61
7.3.160.0090.00916.56
7.3.120.0030.01414.98
7.3.110.0070.00714.68
7.3.100.0030.01315.09
7.3.90.0100.00614.70
7.3.80.0070.00714.83
7.3.70.0040.01214.93
7.3.60.0100.00714.69
7.3.50.0100.00314.90
7.3.40.0070.00714.84
7.3.30.0100.00714.86
7.3.20.0030.01016.50
7.3.10.0070.00916.39
7.3.00.0050.00816.64
7.2.330.0070.01016.64
7.2.320.0060.01216.60
7.2.310.0030.01316.71
7.2.300.0100.01316.60
7.2.290.0100.00816.74
7.2.240.0040.01215.16
7.2.230.0000.01014.89
7.2.220.0030.01315.18
7.2.210.0040.01415.03
7.2.200.0000.01814.96
7.2.190.0060.00615.07
7.2.180.0090.00915.13
7.2.170.0070.01115.03
7.2.160.0030.01315.15
7.2.150.0030.01316.70
7.2.140.0060.00916.96
7.2.130.0100.00617.02
7.2.120.0040.01016.91
7.2.110.0060.00816.84
7.2.100.0060.00716.97
7.2.90.0070.00616.91
7.2.80.0070.00917.11
7.2.70.0060.00816.91
7.2.60.0050.01016.86
7.2.50.0050.00816.94
7.2.40.0050.00616.96
7.2.30.0050.01016.90
7.2.20.0050.00916.88
7.2.10.0080.00316.83
7.2.00.0050.01016.90
7.1.330.0000.01215.70
7.1.320.0000.01315.68
7.1.310.0100.00615.59
7.1.300.0100.00615.78
7.1.290.0090.00615.73
7.1.280.0000.01515.60
7.1.270.0030.00715.82
7.1.260.0070.00715.82
7.1.250.0100.00215.83
7.1.200.0040.00815.55
7.1.70.1720.01315.40
7.1.60.1940.01533.21
7.1.50.2000.01032.90
7.1.40.1760.00932.44
7.1.30.1670.01432.75
7.1.20.1970.01332.72
7.1.10.1690.01314.52
7.1.00.1290.00314.66
7.0.200.1760.01614.65
7.0.190.1770.01014.82
7.0.180.1560.01714.38
7.0.170.1720.01214.52
7.0.160.1760.01014.39
7.0.150.1570.01014.45
7.0.140.1640.01014.65
7.0.130.1500.01314.82
7.0.120.1310.01014.67
7.0.110.1240.01314.52
7.0.100.1360.01014.79
7.0.90.1610.00614.62
7.0.80.1590.01014.59
7.0.70.1140.01314.50
7.0.60.1570.01314.49
7.0.50.1700.01614.61
7.0.40.1290.01314.89
7.0.30.1230.01614.87
7.0.20.1370.01314.67
7.0.10.1300.01014.69
7.0.00.1830.01314.55

preferences:
106.05 ms | 1641 KiB | 5 Q