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); var_dump($toFind, $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++; continue 2; } } } 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.40.0130.00318.65
8.3.30.0070.01419.04
8.3.20.0040.00420.16
8.3.10.0050.00321.96
8.3.00.0000.01022.43
8.2.170.0070.01122.96
8.2.160.0040.01119.21
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0170.00026.16
8.2.120.0050.00319.54
8.2.110.0030.00622.30
8.2.100.0090.00317.79
8.2.90.0050.00317.79
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0000.00818.00
8.2.50.0030.00618.07
8.2.40.0030.00518.16
8.2.30.0040.00417.98
8.2.20.0030.00517.71
8.2.10.0030.00517.67
8.2.00.0080.00017.79
8.1.270.0090.00018.34
8.1.260.0000.00926.35
8.1.250.0020.00528.09
8.1.240.0040.00721.91
8.1.230.0110.00020.91
8.1.220.0070.00317.74
8.1.210.0000.00818.90
8.1.200.0030.00617.35
8.1.190.0040.00417.18
8.1.180.0000.00818.40
8.1.170.0000.00818.50
8.1.160.0020.00522.20
8.1.150.0100.00018.68
8.1.140.0040.00417.49
8.1.130.0050.00217.83
8.1.120.0000.00717.36
8.1.110.0000.00817.36
8.1.100.0040.00417.32
8.1.90.0000.00717.32
8.1.80.0000.00817.44
8.1.70.0000.00717.34
8.1.60.0030.00617.49
8.1.50.0060.00317.54
8.1.40.0000.00917.47
8.1.30.0000.00817.56
8.1.20.0040.00417.56
8.1.10.0000.00717.57
8.1.00.0000.00817.38
8.0.300.0050.00320.02
8.0.290.0040.00417.16
8.0.280.0070.00018.44
8.0.270.0070.00017.11
8.0.260.0030.00316.86
8.0.250.0040.00316.86
8.0.240.0080.00016.93
8.0.230.0030.00316.83
8.0.220.0030.00316.87
8.0.210.0080.00016.91
8.0.200.0060.00016.95
8.0.190.0000.00716.95
8.0.180.0040.00416.95
8.0.170.0080.00016.93
8.0.160.0050.00216.77
8.0.150.0070.00016.82
8.0.140.0000.00716.83
8.0.130.0000.00613.27
8.0.120.0030.00616.74
8.0.110.0000.00816.86
8.0.100.0050.00216.84
8.0.90.0000.00716.94
8.0.80.0050.01316.88
8.0.70.0040.00416.78
8.0.60.0000.00716.83
8.0.50.0040.00416.81
8.0.30.0120.00717.05
8.0.20.0090.01117.40
8.0.10.0050.00317.05
8.0.00.0150.00616.64
7.4.330.0000.00515.00
7.4.320.0050.00216.64
7.4.300.0030.00316.58
7.4.290.0070.00016.61
7.4.280.0050.00316.41
7.4.270.0030.00316.51
7.4.260.0000.00716.39
7.4.250.0040.00416.47
7.4.240.0050.00316.56
7.4.230.0030.00316.71
7.4.220.0090.01516.63
7.4.210.0110.00316.55
7.4.200.0040.00416.34
7.4.190.0000.00716.56
7.4.160.0090.00616.50
7.4.150.0130.00317.40
7.4.140.0150.00317.86
7.4.130.0080.01116.45
7.4.120.0130.00516.51
7.4.110.0070.01016.60
7.4.100.0100.01016.72
7.4.90.0160.00016.36
7.4.80.0120.00619.39
7.4.70.0090.00816.45
7.4.60.0230.02916.38
7.4.50.0000.00816.68
7.4.40.0050.00522.77
7.4.30.0160.00016.42
7.4.00.0090.00714.78
7.3.330.0000.00613.24
7.3.320.0060.00013.37
7.3.310.0070.00016.38
7.3.300.0050.00216.43
7.3.290.0090.00616.38
7.3.280.0050.01116.40
7.3.270.0070.01017.40
7.3.260.0070.01016.68
7.3.250.0060.01216.46
7.3.240.0120.00616.50
7.3.230.0100.00716.66
7.3.210.0080.01116.34
7.3.200.0040.01419.39
7.3.190.0130.00716.39
7.3.180.0130.01016.52
7.3.170.0070.01016.37
7.3.160.0110.00516.65
7.3.120.0090.00714.90
7.3.110.0030.01315.12
7.3.100.0030.01514.84
7.3.90.0060.01014.77
7.3.80.0030.01214.75
7.3.70.0060.00915.02
7.3.60.0070.01014.68
7.3.50.0070.00714.97
7.3.40.0060.00614.71
7.3.30.0030.01014.88
7.3.20.0040.00816.78
7.3.10.0070.00716.41
7.3.00.0000.00916.54
7.2.330.0070.01616.85
7.2.320.0160.00616.77
7.2.310.0030.01916.78
7.2.300.0040.01216.64
7.2.290.0030.01716.84
7.2.250.0130.00715.31
7.2.240.0000.01614.91
7.2.230.0080.00614.96
7.2.220.0060.00615.08
7.2.210.0030.01614.96
7.2.200.0070.01015.09
7.2.190.0030.01214.81
7.2.180.0090.00315.02
7.2.170.0100.00614.86
7.2.160.0100.00714.79
7.2.150.0000.00916.98
7.2.140.0070.00416.97
7.2.130.0100.01017.07
7.2.120.0100.00016.67
7.2.110.0060.00916.99
7.2.100.0060.00916.69
7.2.90.0040.01416.97
7.2.80.0090.00316.92
7.2.70.0060.01017.12
7.2.60.0040.01117.12
7.2.50.0070.00717.07
7.2.40.0060.00617.15
7.2.30.0100.00717.00
7.2.20.0090.00317.16
7.2.10.0000.00917.11
7.2.00.0000.01317.12
7.1.330.0130.00315.73
7.1.320.0080.00415.66
7.1.310.0090.00916.19
7.1.300.0040.01115.88
7.1.290.0060.00615.85
7.1.280.0070.00715.89
7.1.270.0090.00015.91
7.1.260.0030.00515.85
7.1.250.0030.01215.71
7.1.240.0080.00415.79
7.1.230.0000.01415.80
7.1.220.0090.00615.82
7.1.210.0060.00915.89
7.1.200.0100.00315.71
7.1.190.0100.00315.97
7.1.180.0040.00715.72
7.1.170.0060.00315.91
7.1.160.0080.00415.83
7.1.150.0030.00915.95
7.1.140.0040.00815.53
7.1.130.0000.00815.93
7.1.120.0030.01415.61
7.1.110.0060.00315.97
7.1.100.0020.00716.92
7.1.90.0070.00715.68
7.1.80.0030.00715.79
7.1.70.0070.00416.43
7.1.60.0110.00817.77
7.1.50.0030.01516.21
7.1.40.0070.01015.95
7.1.30.0070.00715.75
7.1.20.0110.00315.55
7.1.10.0030.00815.66
7.1.00.0020.02818.96
7.0.330.0060.00915.37
7.0.320.0030.00915.20
7.0.310.0070.00715.41
7.0.300.0070.00415.30
7.0.290.0000.01515.43
7.0.280.0030.01315.29
7.0.270.0000.01115.65
7.0.260.0040.00415.33
7.0.250.0060.00615.39
7.0.240.0040.00815.40
7.0.230.0090.00315.42
7.0.220.0090.00015.46
7.0.210.0100.00315.19
7.0.200.0090.00816.04
7.0.190.0030.01015.37
7.0.180.0030.00615.60
7.0.170.0060.00615.44
7.0.160.0060.00615.29
7.0.150.0030.01015.22
7.0.140.0040.04218.72
7.0.130.0100.00315.27
7.0.120.0110.00415.59
7.0.110.0100.00015.48
7.0.100.0070.01015.39
7.0.90.0030.00915.15
7.0.80.0030.00915.40
7.0.70.0090.00015.54
7.0.60.0080.04217.69
7.0.50.0080.02516.75
7.0.40.0060.02116.86
7.0.30.0180.04416.79
7.0.20.0190.03316.87
7.0.10.0120.03916.86
7.0.00.0100.03416.86
5.6.400.0070.00714.50
5.6.390.0070.00714.30
5.6.380.0060.00914.31
5.6.370.0060.01014.56
5.6.360.0080.00714.71
5.6.350.0070.01114.56
5.6.340.0060.00614.44
5.6.330.0070.01114.05
5.6.320.0040.00414.39
5.6.310.0070.00714.62
5.6.300.0040.00714.54
5.6.290.0080.00314.21
5.6.280.0030.05017.71
5.6.270.0040.01414.31
5.6.260.0070.01114.50
5.6.250.0030.00614.45
5.6.240.0100.00314.58
5.6.230.0060.00614.63
5.6.220.0070.01114.36
5.6.210.0030.04017.40
5.6.200.0060.02316.28
5.6.190.0050.04317.32
5.6.180.1680.02417.51
5.6.170.0200.02417.40
5.6.160.0110.04117.40
5.6.150.0010.04816.17
5.6.140.0070.02216.23
5.6.130.0110.04016.15
5.6.120.0030.02617.82
5.6.110.0080.04817.70
5.6.100.0070.02317.57
5.6.90.0070.04417.58
5.6.80.0080.04517.31
5.6.70.0130.03617.37
5.6.60.0000.01014.33
5.6.50.0130.00314.28
5.6.40.0060.00314.06
5.6.30.0030.00914.38
5.6.20.0060.00314.67
5.6.10.0040.01214.20
5.6.00.0000.01214.21
5.5.380.0000.00914.42
5.5.370.0040.01114.73
5.5.360.0070.00714.70
5.5.350.0120.02517.27
5.5.340.0030.02516.12
5.5.330.0030.03617.55
5.5.320.0210.03917.32
5.5.310.0190.02817.42
5.5.300.0080.02016.09
5.5.290.0100.03816.30
5.5.280.0110.02217.55
5.5.270.0050.02317.68
5.5.260.0030.04117.58
5.5.250.0070.04317.37
5.5.240.0030.02517.17
5.5.230.0030.01314.36
5.5.220.0060.00914.55
5.5.210.0040.01114.24
5.5.200.0030.00614.38
5.5.190.0090.00614.14
5.5.180.0040.00814.32
5.5.170.0040.01214.42
5.5.160.0000.01314.13
5.5.150.0090.00914.13
5.5.140.0070.01014.44
5.5.130.0080.00814.48
5.5.120.0050.00514.43
5.5.110.0030.00514.34
5.5.100.0000.01014.20
5.5.90.0090.00614.39
5.5.80.0140.00314.09
5.5.70.0000.01114.25
5.5.60.0000.01014.08
5.5.50.0040.00413.89
5.5.40.0030.01014.39
5.5.30.0060.00614.33
5.5.20.0030.01014.22
5.5.10.0080.00614.43
5.5.00.0070.00314.12
5.4.450.0300.03215.79
5.4.440.0370.03315.73
5.4.430.0370.02715.58
5.4.420.0100.02815.66
5.4.410.0420.02515.67
5.4.400.0520.04215.25
5.4.390.0730.03415.22
5.4.380.0150.03115.37
5.4.370.0110.02815.33
5.4.360.0080.03015.33
5.4.350.0070.03015.23
5.4.340.0130.02815.29
5.4.330.0000.01011.99
5.4.320.0040.03112.25
5.4.310.0070.02512.25
5.4.300.0040.02612.25
5.4.290.0030.02412.25
5.4.280.0040.02012.20
5.4.270.0060.02312.20
5.4.260.0070.02012.20
5.4.250.0080.03015.50
5.4.240.0080.02715.37
5.4.230.0070.04015.46
5.4.220.0060.02915.43
5.4.210.0090.02815.46
5.4.200.0030.04215.43
5.4.190.0120.02515.45
5.4.180.0050.03215.48
5.4.170.0050.03015.31
5.4.160.0130.02215.46
5.4.150.0010.03415.46
5.4.140.0050.02814.27
5.4.130.0070.02314.17
5.4.120.0070.02514.20
5.4.110.0070.02614.16
5.4.100.0060.03514.18
5.4.90.0060.02614.31
5.4.80.0070.02914.13
5.4.70.0050.02714.29
5.4.60.0030.02914.29
5.4.50.0020.03014.15
5.4.40.0070.02814.28
5.4.30.0090.02514.13
5.4.20.0080.02514.17
5.4.10.0070.03214.21
5.4.00.0070.03213.98
5.3.290.0060.02112.40
5.3.280.0080.03313.29
5.3.270.0050.03013.25
5.3.260.0030.03313.25
5.3.250.0050.02813.34
5.3.240.0050.02713.34
5.3.230.0020.03113.25
5.3.220.0040.03213.32
5.3.210.0060.03213.36
5.3.200.0080.02513.39
5.3.190.0070.02813.32
5.3.180.0090.02513.39
5.3.170.0060.02813.32
5.3.160.0070.02713.23
5.3.150.0020.03013.32
5.3.140.0060.02813.20
5.3.130.0080.03013.31
5.3.120.0070.03013.31
5.3.110.0070.02813.38
5.3.100.0070.03113.05
5.3.90.0050.02813.09
5.3.80.0100.03213.05
5.3.70.0080.03613.02
5.3.60.0050.03012.91
5.3.50.0080.02713.00
5.3.40.0070.02713.00
5.3.30.0020.03212.99
5.3.20.0070.02812.88
5.3.10.0080.02212.77
5.3.00.0030.03112.90
5.2.170.0070.05310.97
5.2.160.0000.06311.10
5.2.150.0070.04011.21
5.2.140.0030.04711.16
5.2.130.0030.04711.01
5.2.120.0070.03711.17
5.2.110.0030.04011.11
5.2.100.0000.04311.08
5.2.90.0100.03311.17
5.2.80.0070.04011.31
5.2.70.0030.04311.16
5.2.60.0030.04311.14
5.2.50.0070.04011.01
5.2.40.0000.05010.99
5.2.30.0070.04011.13
5.2.20.0100.03310.93
5.2.10.0030.04010.93
5.2.00.0100.03710.71
5.1.60.0070.03310.05
5.1.50.0070.05010.15
5.1.40.0100.0279.94
5.1.30.0070.03710.32
5.1.20.0030.03710.36
5.1.10.0070.05310.16
5.1.00.0070.03310.13
5.0.50.0070.0238.63
5.0.40.0030.0308.38
5.0.30.0000.0438.16
5.0.20.0030.0278.20
5.0.10.0000.0308.34
5.0.00.0030.0408.17
4.4.90.0000.0237.02
4.4.80.0000.0277.02
4.4.70.0000.0237.02
4.4.60.0030.0207.02
4.4.50.0030.0207.02
4.4.40.0000.0377.02
4.4.30.0030.0207.02
4.4.20.0030.0237.02
4.4.10.0000.0237.02
4.4.00.0030.0337.02
4.3.110.0070.0177.02
4.3.100.0000.0207.02
4.3.90.0030.0207.30
4.3.80.0100.0277.30
4.3.70.0000.0237.30
4.3.60.0000.0277.30
4.3.50.0100.0207.30
4.3.40.0030.0337.30
4.3.30.0000.0237.30
4.3.20.0030.0207.30
4.3.10.0030.0277.30
4.3.00.0200.0206.75

preferences:
76.14 ms | 400 KiB | 5 Q