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 = $i+1; $j < $nb; $j++){ 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.0120.00318.36
8.3.50.0150.00817.36
8.3.40.0190.00318.81
8.3.30.0110.00418.70
8.3.20.0080.00018.72
8.3.10.0040.00418.74
8.3.00.0060.00319.38
8.2.180.0070.00718.42
8.2.170.0150.00722.96
8.2.160.0070.00718.79
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00820.75
8.2.110.0030.00620.29
8.2.100.0040.00817.91
8.2.90.0000.00917.88
8.2.80.0040.00418.76
8.2.70.0060.00317.63
8.2.60.0040.00417.75
8.2.50.0050.00317.63
8.2.40.0000.01219.47
8.2.30.0000.00917.66
8.2.20.0060.00317.72
8.2.10.0040.00417.77
8.2.00.0090.00017.65
8.1.280.0060.01225.92
8.1.270.0100.00323.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01023.91
8.1.230.0070.00420.99
8.1.220.0000.00818.56
8.1.210.0000.00918.77
8.1.200.0050.00317.38
8.1.190.0070.00516.63
8.1.180.0040.00418.10
8.1.170.0050.00317.62
8.1.160.0060.00318.52
8.1.150.0000.00718.62
8.1.140.0040.00417.41
8.1.130.0000.00717.32
8.1.120.0000.00817.48
8.1.110.0000.00817.43
8.1.100.0040.00417.40
8.1.90.0000.00717.32
8.1.80.0040.00417.46
8.1.70.0080.00017.34
8.1.60.0040.00417.64
8.1.50.0040.00417.46
8.1.40.0000.00917.50
8.1.30.0060.00317.61
8.1.20.0020.00517.51
8.1.10.0080.00017.62
8.1.00.0000.00817.54
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0070.00017.96
8.0.270.0030.00317.16
8.0.260.0030.00316.76
8.0.250.0050.00316.98
8.0.240.0060.00317.00
8.0.230.0000.00816.93
8.0.220.0020.00516.95
8.0.210.0040.00416.95
8.0.200.0070.00016.92
8.0.190.0030.00616.97
8.0.180.0040.00416.95
8.0.170.0000.00916.84
8.0.160.0000.00817.05
8.0.150.0040.00416.91
8.0.140.0040.00716.87
8.0.130.0060.00313.38
8.0.120.0070.00316.79
8.0.110.0000.00916.89
8.0.100.0020.00516.71
8.0.90.0000.00716.79
8.0.80.0070.00716.89
8.0.70.0020.00517.04
8.0.60.0030.00516.98
8.0.50.0060.00316.79
8.0.30.0120.00916.87
8.0.20.0060.01217.14
8.0.10.0000.00717.00
8.0.00.0140.00417.03
7.4.330.0000.00513.10
7.4.320.0040.00416.51
7.4.300.0000.00716.51
7.4.290.0030.00316.52
7.4.280.0060.00316.59
7.4.270.0030.00316.58
7.4.260.0030.00313.31
7.4.250.0040.00416.56
7.4.240.0070.00016.49
7.4.230.0070.00016.71
7.4.220.0100.00716.64
7.4.210.0030.01216.45
7.4.200.0030.00316.43
7.4.190.0050.00316.47
7.4.160.0080.00816.27
7.4.150.0120.00616.59
7.4.140.0160.01017.86
7.4.130.0130.01316.79
7.4.120.0150.00916.39
7.4.110.0150.00316.48
7.4.100.0130.00416.44
7.4.90.0080.01016.32
7.4.80.0140.00319.39
7.4.70.0120.01216.64
7.4.60.0100.01316.66
7.4.50.0000.00616.45
7.4.40.0060.00916.39
7.4.30.0060.00916.46
7.4.00.0100.00714.72
7.3.330.0060.00013.39
7.3.320.0000.00613.36
7.3.310.0000.00716.42
7.3.300.0030.00516.28
7.3.290.0090.00616.37
7.3.280.0110.00616.39
7.3.270.0100.00716.53
7.3.260.0130.00616.50
7.3.240.0080.00816.49
7.3.230.0160.00716.59
7.3.210.0070.01116.68
7.3.200.0160.00016.39
7.3.190.0130.00316.46
7.3.180.0150.00016.49
7.3.170.0030.01316.46
7.3.160.0130.00316.43
7.3.120.0030.01314.87
7.3.10.0100.00616.24
7.3.00.0110.00616.43
7.2.330.0070.01016.78
7.2.320.0120.00616.84
7.2.310.0070.01116.58
7.2.300.0100.00616.83
7.2.290.0090.01016.88
7.2.130.0100.01016.82
7.2.120.0090.00716.97
7.2.110.0070.01016.84
7.2.100.0070.01016.66
7.2.90.0120.00616.92
7.2.80.0100.00716.96
7.2.70.0090.00816.80
7.2.60.0060.01116.94
7.2.50.0100.00616.82
7.2.40.0110.00316.93
7.2.30.0030.01116.98
7.2.20.0070.00816.58
7.2.10.0070.01216.75
7.2.00.0090.00617.72
7.1.250.0140.00215.61
7.1.200.0040.00815.85
7.1.100.0040.01118.12
7.1.70.0070.00317.34
7.1.60.0070.01719.25
7.1.50.0190.00434.98
7.1.00.0030.03322.55
7.0.200.0170.00716.63
7.0.140.0100.06722.02
7.0.120.0030.06721.95
7.0.60.0100.07020.04
7.0.50.0400.04317.87
7.0.40.0070.07717.75
7.0.30.0100.08317.86
7.0.20.0100.07717.79
7.0.10.0030.08017.84
7.0.00.0070.04017.73
5.6.210.0130.03020.67
5.6.200.0130.07318.19
5.6.190.0200.06718.19
5.6.180.0030.08718.23
5.6.170.0130.07718.27
5.6.160.0100.03718.18
5.6.150.0100.05718.16
5.6.140.0070.08718.28
5.6.130.0130.07018.10
5.6.120.0100.08018.20
5.6.110.0170.08018.15
5.6.100.0030.07318.16
5.6.90.0000.05718.13
5.6.80.0030.08017.54
5.6.70.0070.05017.52
5.6.60.0130.06717.56
5.6.50.0100.06717.66
5.6.40.0030.05017.46
5.6.30.0100.07717.61
5.6.20.0070.08017.61
5.6.10.0130.07317.51
5.6.00.0000.04317.52
5.5.350.0230.08020.39
5.5.340.0030.05317.97
5.5.330.0070.08318.08
5.5.320.0100.08017.94
5.5.310.0070.08018.04
5.5.300.0070.08317.98
5.5.290.0070.08018.08
5.5.280.0130.05318.02
5.5.270.0130.07317.99
5.5.260.0130.07317.94
5.5.250.0070.07017.77
5.5.240.0100.05717.33
5.5.230.0030.07317.36
5.5.220.0170.06317.44
5.5.210.0130.05717.45
5.5.200.0070.07717.31
5.5.190.0130.04317.40
5.5.180.0030.05017.31
5.5.160.0130.03317.35
5.5.150.0100.04317.33
5.5.140.0100.04317.27
5.5.130.0070.07317.43
5.5.120.0030.07317.33
5.5.110.0100.07017.29
5.5.100.0130.05717.29
5.5.90.0130.07017.34
5.5.80.0070.07017.24
5.5.70.0070.07717.18
5.5.60.0030.07717.16
5.5.50.0070.07717.22
5.5.40.0130.07017.33
5.5.30.0170.05017.21
5.5.20.0030.08317.21
5.5.10.0030.05317.16
5.5.00.0070.07317.32
5.4.450.0000.08719.36
5.4.440.0100.07019.39
5.4.430.0170.04719.30
5.4.420.0200.06319.39
5.4.410.0000.04319.23
5.4.400.0070.06319.10
5.4.390.0000.05019.01
5.4.380.0070.06719.09
5.4.370.0100.05319.02
5.4.360.0000.05319.04
5.4.350.0100.06019.27
5.4.340.0000.05018.95
5.4.320.0070.07719.01
5.4.310.0100.04019.12
5.4.300.0070.08019.11
5.4.290.0070.04318.88
5.4.280.0100.07319.03
5.4.270.0030.05018.95
5.4.260.0100.07019.02
5.4.250.0100.06319.21
5.4.240.0070.05319.04
5.4.230.0130.04019.12
5.4.220.0030.06719.08
5.4.210.0100.07718.96
5.4.200.0030.07719.04
5.4.190.0030.06319.10
5.4.180.0070.07318.94
5.4.170.0070.06318.98
5.4.160.0070.06019.02
5.4.150.0100.07319.02
5.4.140.0070.03716.39
5.4.130.0030.07316.46
5.4.120.0130.03716.41
5.4.110.0030.03716.45
5.4.100.0030.03716.45
5.4.90.0100.03316.20
5.4.80.0170.07016.41
5.4.70.0100.07016.39
5.4.60.0030.06316.61
5.4.50.0030.04716.26
5.4.40.0000.07716.46
5.4.30.0030.04716.28
5.4.20.0030.03716.37
5.4.10.0030.08316.31
5.4.00.0030.07315.83
5.3.290.0030.08314.69
5.3.280.0070.04314.61
5.3.270.0000.08714.57
5.3.260.0030.04314.65
5.3.250.0070.08014.65
5.3.240.0070.07714.65
5.3.230.0100.06714.68
5.3.220.0030.07714.56
5.3.210.0100.03714.78
5.3.200.0030.08014.61
5.3.190.0170.06714.60
5.3.180.0130.04714.61
5.3.170.0170.05314.61
5.3.160.0070.06714.52
5.3.150.0100.06714.38
5.3.140.0130.07014.61
5.3.130.0130.07314.63
5.3.120.0100.07714.62
5.3.110.0030.04714.40
5.3.100.0100.07714.06
5.3.90.0000.07714.04
5.3.80.0130.04714.05
5.3.70.0030.05314.00
5.3.60.0030.04313.88
5.3.50.0030.08013.79
5.3.40.0070.05313.98
5.3.30.0070.03713.93
5.3.20.0000.05013.74
5.3.10.0000.04013.55
5.3.00.0030.03313.84
5.2.170.0070.06311.11
5.2.160.0030.05311.19
5.2.150.0030.03311.05
5.2.140.0000.03011.13
5.2.130.0000.03311.21
5.2.120.0030.02711.21
5.2.110.0000.03010.95
5.2.100.0030.03011.01
5.2.90.0000.03711.17
5.2.80.0030.03011.05
5.2.70.0000.03011.13
5.2.60.0000.03011.02
5.2.50.0000.03310.98
5.2.40.0000.03011.10
5.2.30.0070.02311.04
5.2.20.0000.03010.92
5.2.10.0000.03310.85
5.2.00.0030.02710.79
5.1.60.0000.0279.99
5.1.50.0000.0239.95
5.1.40.0030.0209.81
5.1.30.0000.02710.20
5.1.20.0000.02710.41
5.1.10.0030.02310.10
5.1.00.0070.0239.90
5.0.50.0100.0108.62
5.0.40.0030.0178.46
5.0.30.0030.0278.28
5.0.20.0000.0208.14
5.0.10.0030.0178.13
5.0.00.0000.0338.27
4.4.90.0000.0207.52
4.4.80.0000.0177.52
4.4.70.0030.0137.52
4.4.60.0000.0177.52
4.4.50.0030.0177.52
4.4.40.0000.0237.52
4.4.30.0000.0177.52
4.4.20.0000.0177.52
4.4.10.0000.0177.52
4.4.00.0000.0237.52
4.3.110.0000.0137.52
4.3.100.0000.0137.52
4.3.90.0000.0177.52
4.3.80.0030.0207.52
4.3.70.0000.0137.52
4.3.60.0000.0177.52
4.3.50.0000.0177.52
4.3.40.0030.0307.52
4.3.30.0000.0177.52
4.3.20.0030.0137.52
4.3.10.0000.0177.52
4.3.00.0000.0137.52

preferences:
50.42 ms | 401 KiB | 5 Q