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($toTry[$i] === $toFind[$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.0170.00316.61
8.3.50.0050.01222.16
8.3.40.0110.00418.79
8.3.30.0070.00719.09
8.3.20.0070.00020.20
8.3.10.0040.00423.48
8.3.00.0000.00819.17
8.2.180.0090.00616.35
8.2.170.0070.00722.96
8.2.160.0080.00620.29
8.2.150.0080.00024.18
8.2.140.0070.01124.66
8.2.130.0000.00726.16
8.2.120.0040.00420.59
8.2.110.0090.00022.27
8.2.100.0040.00817.91
8.2.90.0000.00719.02
8.2.80.0000.00717.97
8.2.70.0070.00317.63
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0060.00318.27
8.2.20.0040.00417.64
8.2.10.0040.00418.04
8.2.00.0000.00717.88
8.1.280.0100.01025.92
8.1.270.0040.00423.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.11
8.1.230.0110.00019.15
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0040.00417.22
8.1.190.0000.00917.13
8.1.180.0040.00418.10
8.1.170.0050.00318.57
8.1.160.0040.00422.00
8.1.150.0030.00618.61
8.1.140.0040.00417.49
8.1.130.0000.00717.76
8.1.120.0000.00717.45
8.1.110.0000.00817.49
8.1.100.0080.00017.36
8.1.90.0060.00417.52
8.1.80.0040.00417.54
8.1.70.0000.00717.36
8.1.60.0030.00617.62
8.1.50.0000.00917.54
8.1.40.0000.00817.41
8.1.30.0030.00617.65
8.1.20.0040.00417.65
8.1.10.0000.00817.57
8.1.00.0040.00717.41
8.0.300.0040.00418.77
8.0.290.0040.00417.05
8.0.280.0000.00718.48
8.0.270.0030.00317.24
8.0.260.0070.00017.20
8.0.250.0030.00317.00
8.0.240.0000.00617.02
8.0.230.0030.00316.91
8.0.220.0040.00416.98
8.0.210.0030.00316.80
8.0.200.0000.00616.90
8.0.190.0040.00416.83
8.0.180.0040.00417.00
8.0.170.0030.00516.85
8.0.160.0000.00716.87
8.0.150.0070.00016.86
8.0.140.0030.00516.85
8.0.130.0050.00013.38
8.0.120.0030.00716.84
8.0.110.0050.00316.84
8.0.100.0000.00716.77
8.0.90.0050.00216.87
8.0.80.0160.00016.87
8.0.70.0040.00416.98
8.0.60.0000.00716.98
8.0.50.0050.00316.90
8.0.30.0120.00716.88
8.0.20.0150.00417.40
8.0.10.0000.00817.09
8.0.00.0140.00616.63
7.4.330.0050.00015.13
7.4.320.0070.00016.66
7.4.300.0000.00716.50
7.4.290.0040.00416.45
7.4.280.0040.00416.63
7.4.270.0000.00816.60
7.4.260.0070.00016.50
7.4.250.0040.00416.44
7.4.240.0020.00516.56
7.4.230.0070.00016.50
7.4.220.0170.00016.56
7.4.210.0030.01416.53
7.4.200.0040.00416.50
7.4.190.0040.00416.53
7.4.160.0090.00616.57
7.4.150.0120.00617.40
7.4.140.0110.00817.86
7.4.130.0080.01316.51
7.4.120.0070.01116.54
7.4.110.0120.00916.67
7.4.100.0080.01116.39
7.4.90.0130.00416.35
7.4.80.0080.00919.39
7.4.70.0050.01116.47
7.4.60.0070.01016.54
7.4.50.0040.00416.44
7.4.40.0070.01016.58
7.4.30.0100.00516.62
7.4.00.0100.00715.14
7.3.330.0060.00013.40
7.3.320.0000.00613.19
7.3.310.0070.00016.38
7.3.300.0060.00016.42
7.3.290.0100.00316.38
7.3.280.0110.01016.40
7.3.270.0120.00617.40
7.3.260.0120.00616.43
7.3.250.0080.01316.68
7.3.240.0040.01216.40
7.3.230.0070.01416.44
7.3.210.0000.01616.43
7.3.200.0040.01519.39
7.3.190.0130.00416.60
7.3.180.0030.01316.36
7.3.170.0130.00316.36
7.3.160.0100.00716.69
7.3.120.0060.01114.82
7.3.10.0030.01016.69
7.3.00.0070.00716.70
7.2.330.0110.00716.64
7.2.320.0100.00716.86
7.2.310.0180.00416.58
7.2.300.0100.00716.72
7.2.290.0110.00716.83
7.2.130.0080.00416.84
7.2.120.0030.00717.01
7.2.110.0030.00717.01
7.2.100.0040.00817.02
7.2.90.0030.01016.95
7.2.80.0070.00717.00
7.2.70.0030.01016.75
7.2.60.0030.01416.68
7.2.50.0030.01217.05
7.2.40.0060.01017.21
7.2.30.0070.00416.99
7.2.20.0040.00717.00
7.2.10.0000.01316.96
7.2.00.0030.00918.34
7.1.250.0080.00315.90
7.1.200.0000.00815.98
7.1.100.0080.00318.42
7.1.70.0140.01116.93
7.1.60.0160.00619.70
7.1.50.0160.01017.02
7.1.00.0030.09022.43
7.0.200.0060.00316.71
7.0.140.0100.06721.95
7.0.60.0200.06719.86
7.0.50.0170.06717.89
7.0.40.0070.05020.25
7.0.30.0000.04720.18
7.0.20.0070.05020.18
7.0.10.0070.04020.18
7.0.00.0070.04020.25
5.6.280.0000.07721.13
5.6.210.0030.04320.51
5.6.200.0070.08018.29
5.6.190.0070.04020.43
5.6.180.0130.04320.33
5.6.170.0130.03320.52
5.6.160.0000.04320.76
5.6.150.0000.04720.31
5.6.140.0000.05020.17
5.6.130.0030.04020.23
5.6.120.0030.04020.32
5.6.110.0030.04020.17
5.6.100.0030.04020.48
5.6.90.0030.04320.17
5.6.80.0030.04319.62
5.6.70.0070.03719.61
5.6.60.0000.04319.78
5.6.50.0030.04019.77
5.6.40.0030.04019.53
5.6.30.0100.03319.55
5.6.20.0070.03719.85
5.6.10.0030.04019.68
5.6.00.0030.04019.52
5.5.350.0000.04720.32
5.5.340.0100.03318.03
5.5.330.0100.07320.34
5.5.320.0130.07320.32
5.5.310.0000.04720.37
5.5.300.0030.04319.97
5.5.290.0000.04320.34
5.5.280.0030.04020.17
5.5.270.0030.04020.34
5.5.260.0030.04320.19
5.5.250.0000.04319.94
5.5.240.0030.04019.63
5.5.230.0030.04019.51
5.5.220.0070.04019.50
5.5.210.0000.04319.58
5.5.200.0030.03719.68
5.5.190.0030.04019.65
5.5.180.0030.03719.67
5.5.160.0030.04019.64
5.5.150.0000.04319.64
5.5.140.0070.03719.32
5.5.130.0030.05019.54
5.5.120.0030.04319.50
5.5.110.0130.05319.47
5.5.100.0030.04019.30
5.5.90.0070.08019.28
5.5.80.0000.04319.38
5.5.70.0000.08319.38
5.5.60.0100.07019.21
5.5.50.0030.04719.53
5.5.40.0130.07719.38
5.5.30.0030.04019.29
5.5.20.0000.04719.20
5.5.10.0030.05019.31
5.5.00.0000.04719.48
5.4.450.0000.04319.57
5.4.440.0000.04319.48
5.4.430.0000.04019.46
5.4.420.0000.04019.41
5.4.410.0030.03719.04
5.4.400.0000.04019.21
5.4.390.0070.03719.00
5.4.380.0070.04019.15
5.4.370.0100.03018.98
5.4.360.0030.03719.08
5.4.350.0000.04018.85
5.4.340.0030.03718.98
5.4.320.0000.04319.16
5.4.310.0070.03318.85
5.4.300.0070.05318.87
5.4.290.0070.04719.12
5.4.280.0100.03319.12
5.4.270.0030.06018.87
5.4.260.0070.07018.85
5.4.250.0070.03319.11
5.4.240.0030.05718.85
5.4.230.0070.07019.04
5.4.220.0100.05318.83
5.4.210.0070.04719.00
5.4.200.0130.07019.15
5.4.190.0130.05018.84
5.4.180.0100.06318.96
5.4.170.0030.05019.25
5.4.160.0030.04019.22
5.4.150.0070.07718.98
5.4.140.0070.05716.41
5.4.130.0070.07316.40
5.4.120.0070.04716.49
5.4.110.0030.07716.39
5.4.100.0000.04016.30
5.4.90.0030.03716.34
5.4.80.0030.08016.52
5.4.70.0030.06316.38
5.4.60.0000.04316.49
5.4.50.0030.05316.61
5.4.40.0070.03316.43
5.4.30.0030.03716.27
5.4.20.0070.04016.36
5.4.10.0000.05016.42
5.4.00.0070.07315.75
5.3.290.0070.04314.67
5.3.280.0000.08314.67
5.3.270.0030.04714.61
5.3.260.0100.03314.60
5.3.250.0000.05014.63
5.3.240.0030.03714.54
5.3.230.0100.07314.59
5.3.220.0070.05314.48
5.3.210.0000.04014.71
5.3.200.0130.07314.63
5.3.190.0070.04014.63
5.3.180.0030.08014.62
5.3.170.0100.05314.59
5.3.160.0100.06314.71
5.3.150.0070.05714.59
5.3.140.0070.03714.55
5.3.130.0230.06314.54
5.3.120.0070.07014.47
5.3.110.0030.03714.62
5.3.100.0100.07014.09
5.3.90.0030.08014.04
5.3.80.0130.03714.00
5.3.70.0070.06013.91
5.3.60.0070.07014.01
5.3.50.0070.03713.96
5.3.40.0000.04013.84
5.3.30.0000.05713.98
5.3.20.0000.03713.61
5.3.10.0000.04013.65
5.3.00.0070.07013.71
5.2.170.0070.06011.18
5.2.160.0030.03011.10
5.2.150.0030.05711.22
5.2.140.0100.02311.15
5.2.130.0100.04711.11
5.2.120.0000.05011.10
5.2.110.0000.03311.15
5.2.100.0000.03711.16
5.2.90.0000.04011.15
5.2.80.0100.04711.17
5.2.70.0070.06311.13
5.2.60.0030.06011.21
5.2.50.0070.04010.94
5.2.40.0100.05311.04
5.2.30.0070.02710.97
5.2.20.0030.03010.99
5.2.10.0030.03710.86
5.2.00.0100.04710.75
5.1.60.0070.0409.98
5.1.50.0000.0609.98
5.1.40.0030.05010.02
5.1.30.0000.06010.30
5.1.20.0030.05710.36
5.1.10.0100.03710.21
5.1.00.0000.03010.07
5.0.50.0030.0478.55
5.0.40.0070.0178.49
5.0.30.0070.0278.21
5.0.20.0070.0178.17
5.0.10.0030.0378.10
5.0.00.0000.0478.33
4.4.90.0030.0177.71
4.4.80.0100.0177.71
4.4.70.0030.0137.71
4.4.60.0000.0307.71
4.4.50.0070.0337.71
4.4.40.0030.0477.71
4.4.30.0000.0177.71
4.4.20.0130.0237.71
4.4.10.0070.0337.71
4.4.00.0030.0337.71
4.3.110.0000.0207.71
4.3.100.0030.0137.71
4.3.90.0030.0377.71
4.3.80.0000.0307.71
4.3.70.0100.0307.71
4.3.60.0070.0107.71
4.3.50.0000.0177.71
4.3.40.0030.0307.71
4.3.30.0000.0277.71
4.3.20.0000.0377.71
4.3.10.0000.0207.71
4.3.00.0000.0207.71

preferences:
41.95 ms | 401 KiB | 5 Q