3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compareCombinations($toFind, $toTry){ $nb = 4; $goodPlace = 0; $wrongPlace = 0; $toFind = str_split($toFind); $toTry = str_split($toTry); //Look for good places for($i = 0; $i < $nb; $i++){ if($toFind[$i] === $toTry[$i]){ $goodPlace++; } } //Look for wrong places for($i = 0; $i < $nb; $i++){ for($j = 0; $j < $nb; $j++){ if($i == $j){ continue; } if($toFind[$i] === $toTry[$j]){ $wrongPlace++; } } } return array( 'good' => $goodPlace, 'wrong' => $wrongPlace, 'absent' => $nb - $goodPlace - $wrongPlace ); } foreach(array('0000' => '0001') as $find => $try){ $r = compareCombinations($find,$try); var_dump(array( 'find' => $find, 'try' => $try ) + $r); }

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.0060.01518.27
8.3.50.0100.00721.26
8.3.40.0040.01118.73
8.3.30.0070.00719.19
8.3.20.0080.00020.22
8.3.10.0080.00021.97
8.3.00.0040.00422.44
8.2.180.0120.00316.88
8.2.170.0060.01222.96
8.2.160.0070.01119.21
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00819.54
8.2.110.0090.00022.23
8.2.100.0040.00817.91
8.2.90.0040.00417.84
8.2.80.0000.00817.97
8.2.70.0030.00517.50
8.2.60.0050.00318.03
8.2.50.0030.00618.07
8.2.40.0080.00018.22
8.2.30.0040.00417.96
8.2.20.0070.00017.84
8.2.10.0000.00717.84
8.2.00.0040.00417.73
8.1.280.0110.00425.92
8.1.270.0060.00318.43
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0110.00021.90
8.1.230.0000.01020.89
8.1.220.0100.00017.79
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0000.00817.41
8.1.180.0000.00918.62
8.1.170.0080.00018.46
8.1.160.0050.00322.08
8.1.150.0050.00518.58
8.1.140.0040.00417.39
8.1.130.0030.00317.84
8.1.120.0000.00717.54
8.1.110.0040.00417.47
8.1.100.0000.00717.49
8.1.90.0000.00717.39
8.1.80.0040.00417.45
8.1.70.0070.00017.41
8.1.60.0030.00617.59
8.1.50.0000.00817.46
8.1.40.0030.00617.53
8.1.30.0040.00417.64
8.1.20.0000.00817.57
8.1.10.0030.00517.53
8.1.00.0040.00717.41
8.0.300.0060.00319.82
8.0.290.0080.00016.91
8.0.280.0070.00018.25
8.0.270.0040.00417.26
8.0.260.0030.00316.84
8.0.250.0000.00616.88
8.0.240.0040.00416.86
8.0.230.0020.00516.96
8.0.220.0070.00016.98
8.0.210.0040.00416.77
8.0.200.0000.00616.86
8.0.190.0000.00716.99
8.0.180.0050.00316.95
8.0.170.0040.00416.95
8.0.160.0040.00416.90
8.0.150.0000.00816.92
8.0.140.0000.00816.86
8.0.130.0000.00613.27
8.0.120.0040.00416.92
8.0.110.0050.00316.90
8.0.100.0000.00816.77
8.0.90.0000.00716.98
8.0.80.0060.01016.80
8.0.70.0040.00417.03
8.0.60.0020.00516.96
8.0.50.0040.00416.75
8.0.30.0050.01417.30
8.0.20.0030.01517.40
8.0.10.0000.00817.13
8.0.00.0030.01616.68
7.4.330.0050.00015.00
7.4.320.0050.00316.63
7.4.300.0000.00616.50
7.4.290.0000.00616.52
7.4.280.0030.00316.57
7.4.270.0000.00616.62
7.4.260.0000.00716.57
7.4.250.0030.00316.39
7.4.240.0020.00516.58
7.4.230.0000.00816.68
7.4.220.0090.01516.46
7.4.210.0050.00916.59
7.4.200.0000.00816.48
7.4.190.0040.00416.46
7.4.160.0080.00816.50
7.4.150.0090.00917.40
7.4.140.0120.00917.86
7.4.130.0080.01016.45
7.4.120.0100.00716.45
7.4.110.0130.00316.36
7.4.100.0110.00716.67
7.4.90.0070.01016.45
7.4.80.0130.00319.39
7.4.70.0090.01316.33
7.4.60.0160.00016.49
7.4.50.0040.00416.48
7.4.40.0060.00622.77
7.4.30.0080.00816.49
7.4.00.0060.01215.20
7.3.330.0030.00313.24
7.3.320.0050.00013.24
7.3.310.0000.00716.27
7.3.300.0000.00716.29
7.3.290.0030.01016.41
7.3.280.0090.01116.42
7.3.270.0090.00917.40
7.3.260.0040.01316.36
7.3.250.0090.00816.55
7.3.240.0060.01516.28
7.3.230.0140.00316.54
7.3.210.0120.00616.37
7.3.200.0130.00316.40
7.3.190.0120.00616.45
7.3.180.0070.01016.63
7.3.170.0100.00616.54
7.3.160.0080.00816.30
7.3.120.0000.01314.92
7.2.330.0190.01616.83
7.2.320.0130.00716.69
7.2.310.0030.01416.77
7.2.300.0060.01016.45
7.2.290.0110.00516.66
7.1.70.0070.00017.10
7.1.60.0030.00717.25
7.1.50.0040.01917.03
7.1.00.0000.07322.30
7.0.200.0030.00516.94
7.0.140.0070.07322.08
7.0.70.4170.03719.91
7.0.60.0030.04019.98
7.0.50.0070.03717.91
7.0.40.0070.08720.04
7.0.30.0000.06720.16
7.0.20.0230.06020.27
7.0.10.0270.09020.10
7.0.00.0000.09020.20
5.6.280.0170.08020.99
5.6.210.0100.03720.69
5.6.200.0130.07318.25
5.6.190.0030.09020.46
5.6.180.0130.04320.65
5.6.170.0530.05320.48
5.6.160.0100.07720.57
5.6.150.0070.05718.16
5.6.140.0030.05018.28
5.6.130.0070.08318.14
5.6.120.0200.07320.99
5.6.110.0030.04321.00
5.6.100.0130.07021.09
5.6.90.0000.07321.04
5.6.80.0170.07320.53
5.6.70.0370.05720.37
5.5.350.0030.05320.37
5.5.340.0100.07017.95
5.5.330.0070.09020.40
5.5.320.0100.07720.47
5.5.310.0370.06720.34
5.5.300.0000.08718.08
5.5.290.0030.08717.98
5.5.280.0100.04720.89
5.5.270.0130.05720.84
5.5.260.0070.08020.77
5.5.250.0130.07320.44
5.5.240.0030.04020.04
5.4.450.0570.06319.58
5.4.440.0670.06319.48
5.4.430.0800.06019.58
5.4.420.0130.06019.70
5.4.410.0770.05719.17
5.4.400.0830.06318.98
5.4.390.0730.06319.30
5.4.380.0230.06318.50
5.4.370.0370.04318.57
5.4.360.0230.04718.54
5.4.350.0090.03612.02
5.4.340.0100.04412.02
5.4.320.0100.03212.50
5.4.310.0070.03712.50
5.4.300.0040.05312.51
5.4.290.0080.04612.50
5.4.280.0050.03812.40
5.4.270.0060.03512.40
5.4.260.0080.03712.39
5.4.250.0030.06018.86
5.4.240.0130.05018.94
5.4.230.0100.04718.91
5.4.220.0070.06718.98
5.4.210.0100.06718.89
5.4.200.0100.05018.76
5.4.190.0100.05018.90
5.4.180.0100.06718.79
5.4.170.0130.04718.78
5.4.160.0070.05318.80
5.4.150.0030.06018.91
5.4.140.0130.04716.39
5.4.130.0100.04316.54
5.4.120.0000.06016.47
5.4.110.0100.04716.37
5.4.100.0070.05016.41
5.4.90.0070.05016.43
5.4.80.0130.04016.35
5.4.70.0130.06316.32
5.4.60.0100.04716.32
5.4.50.0170.05716.42
5.4.40.0070.04716.55
5.4.30.0000.05316.42
5.4.20.0070.05016.28
5.4.10.0000.06016.36
5.4.00.0100.06015.83
5.3.290.0020.04412.80
5.3.280.0030.05714.67
5.3.270.0070.05314.57
5.3.260.0070.05014.62
5.3.250.0070.07714.57
5.3.240.0070.05314.68
5.3.230.0000.06014.43
5.3.220.0100.05014.49
5.3.210.0100.05014.47
5.3.200.0170.04014.66
5.3.190.0000.05714.66
5.3.180.0070.05014.65
5.3.170.0030.05314.79
5.3.160.0130.04314.64
5.3.150.0030.05714.59
5.3.140.0070.05014.57
5.3.130.0100.05014.38
5.3.120.0200.04014.38
5.3.110.0030.05714.55
5.3.100.0070.05014.17
5.3.90.0130.05013.85
5.3.80.0100.04714.02
5.3.70.0170.05014.04
5.3.60.0170.04314.02
5.3.50.0070.05013.91
5.3.40.0030.05714.03
5.3.30.0100.04313.81
5.3.20.0130.04713.66
5.3.10.0070.06013.73
5.3.00.0000.05713.62
5.2.170.0100.03711.13
5.2.160.0070.05311.22
5.2.150.0030.04311.30
5.2.140.0030.04311.12
5.2.130.0100.03311.08
5.2.120.0030.04011.32
5.2.110.0030.04311.07
5.2.100.0030.04011.17
5.2.90.0000.05011.05
5.2.80.0030.04011.17
5.2.70.0130.05311.31
5.2.60.0100.03710.89
5.2.50.0070.05010.85
5.2.40.0030.05311.09
5.2.30.0030.04011.15
5.2.20.0070.03710.93
5.2.10.0170.02710.95
5.2.00.0030.04010.69
5.1.60.0070.0339.99
5.1.50.0030.03710.08
5.1.40.0030.0339.97
5.1.30.0030.03710.42
5.1.20.0030.03710.45
5.1.10.0030.03310.14
5.1.00.0070.03310.02
5.0.50.0030.0308.59
5.0.40.0070.0238.27
5.0.30.0030.0478.25
5.0.20.0070.0278.19
5.0.10.0100.0278.28
5.0.00.0000.0438.23
4.4.90.0030.0207.30
4.4.80.0100.0177.30
4.4.70.0000.0237.30
4.4.60.0030.0237.30
4.4.50.0070.0177.30
4.4.40.0100.0277.30
4.4.30.0030.0207.30
4.4.20.0030.0207.30
4.4.10.0070.0177.30
4.4.00.0070.0307.30
4.3.110.0070.0177.30
4.3.100.0100.0137.30
4.3.90.0030.0207.30
4.3.80.0070.0277.30
4.3.70.0000.0237.30
4.3.60.0070.0177.30
4.3.50.0030.0207.30
4.3.40.0000.0407.30
4.3.30.0030.0207.30
4.3.20.0070.0177.30
4.3.10.0000.0237.30
4.3.00.0170.0237.54

preferences:
40.64 ms | 401 KiB | 5 Q