3v4l.org

run code in 300+ PHP versions simultaneously
<?phpfunction match($desk, $word) { if($desk == "") return false; if($word == "") return true;  $w = $word[0]; $ws = substr($word, 1);  $pos = strpos($desk, $w); if($pos !== false) { return match(substr($desk, 0, $pos).substr($desk, $pos + 1), $ws); }  $pos = strpos($desk, '*'); if($pos !== false) { return match(substr($desk, 0, $pos).substr($desk, $pos + 1), $ws); }  return false;} function search($tokens, $dictionary) { $filter = function($word) use($tokens) { return match($tokens, $word); };  return array_filter($dictionary, $filter);} function prettyPrint($words) { $compareLength = function($a, $b) { return strlen($a) - strlen($b); };  usort($words, $compareLength); print(implode("\n", $words)."\n");} if(isset($argv[1])) { $firstArg = $argv[1];} else { exit("One parameter needed");} $dictionary = explode("\n", file_get_contents("ODS6.txt")); $results = search(strtoupper($firstArg), $dictionary); prettyPrint($results);

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.0100.00716.75
8.3.50.0060.01122.89
8.3.40.0190.00318.66
8.3.30.0100.00318.96
8.3.20.0040.00420.18
8.3.10.0040.00423.58
8.3.00.0040.00417.38
8.2.180.0130.01016.50
8.2.170.0100.00722.96
8.2.160.0090.00620.52
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00020.89
8.2.110.0060.00319.33
8.2.100.0110.00017.59
8.2.90.0000.00819.08
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0040.00418.22
8.2.30.0050.00317.91
8.2.20.0000.00817.41
8.2.10.0070.00017.89
8.2.00.0040.00417.45
8.1.280.0080.00825.92
8.1.270.0060.00323.84
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.48
8.1.230.0090.00322.69
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0040.00417.10
8.1.180.0040.00418.10
8.1.170.0030.00618.49
8.1.160.0080.00021.93
8.1.150.0040.00418.64
8.1.140.0080.00017.22
8.1.130.0000.00717.67
8.1.120.0070.00017.31
8.1.110.0080.00017.21
8.1.100.0030.00317.34
8.1.90.0040.00417.22
8.1.80.0030.00317.20
8.1.70.0000.00817.22
8.1.60.0030.00617.38
8.1.50.0000.00817.41
8.1.40.0050.00317.26
8.1.30.0000.00817.39
8.1.20.0000.00717.48
8.1.10.0090.00017.45
8.1.00.0000.00817.41
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0030.00318.25
8.0.270.0030.00317.09
8.0.260.0000.00617.23
8.0.250.0000.00616.71
8.0.240.0040.00416.79
8.0.230.0030.00316.66
8.0.220.0070.00016.72
8.0.210.0070.00016.68
8.0.200.0030.00316.70
8.0.190.0030.00316.83
8.0.180.0040.00416.73
8.0.170.0070.00016.76
8.0.160.0030.00316.74
8.0.150.0000.00716.65
8.0.140.0070.00016.71
8.0.130.0040.00413.36
8.0.120.0000.00816.65
8.0.110.0040.00416.74
8.0.100.0050.00216.77
8.0.90.0070.00016.80
8.0.80.0040.01116.71
8.0.70.0000.00816.65
8.0.60.0050.00316.63
8.0.50.0050.00316.58
8.0.30.0100.01017.01
8.0.20.0120.00717.40
8.0.10.0050.00216.84
8.0.00.0070.01116.54
7.4.330.0000.00515.13
7.4.320.0000.00616.44
7.4.300.0000.00816.36
7.4.290.0000.00716.45
7.4.280.0030.00316.50
7.4.270.0030.00316.44
7.4.260.0040.00416.39
7.4.250.0030.00616.23
7.4.240.0020.00516.35
7.4.230.0000.00716.48
7.4.220.0060.01816.47
7.4.210.0080.00816.55
7.4.200.0030.00316.46
7.4.160.0130.00316.16
7.4.150.0120.00917.40
7.4.140.0080.01017.86
7.4.130.0030.01316.47
7.4.120.0080.00816.23
7.4.110.0130.00316.48
7.4.100.0040.01216.34
7.4.90.0160.00316.27
7.4.80.0100.00719.39
7.4.70.0100.00716.58
7.4.60.0070.01016.36
7.4.50.0060.00316.51
7.4.40.0030.01316.19
7.4.30.0060.00916.43
7.3.330.0050.00212.99
7.3.320.0000.00513.09
7.3.310.0030.00316.26
7.3.300.0030.00316.15
7.3.290.0080.00816.09
7.3.280.0140.00816.15
7.3.270.0130.01017.40
7.3.260.0090.01216.30
7.3.240.0080.00816.30
7.3.230.0070.01316.45
7.3.210.0050.01116.39
7.3.200.0080.00819.39
7.3.190.0080.00816.45
7.3.180.0100.00616.23
7.3.170.0030.01216.36
7.3.160.0090.00616.42
7.2.330.0070.01116.46
7.2.320.0120.00616.58
7.2.310.0110.01116.41
7.2.300.0080.00816.16
7.2.290.0110.00516.27
5.4.320.0020.04012.45
5.4.310.0080.03812.45
5.4.300.0050.04012.45
5.4.290.0070.04212.45
5.4.280.0050.03612.34
5.4.270.0040.03812.34
5.4.260.0060.03812.35
5.4.250.0070.03612.34
5.4.240.0100.04612.35
5.4.230.0080.04612.34
5.4.220.0090.04012.34
5.4.210.0050.03712.34
5.4.200.0090.03612.34
5.4.190.0070.03812.34
5.4.180.0080.04312.33
5.4.170.0110.04012.34
5.4.160.0050.04012.34
5.4.150.0070.03812.34
5.4.140.0030.04112.02
5.4.130.0050.03612.01
5.4.120.0100.04011.96
5.4.110.0060.03811.96
5.4.100.0110.04311.96
5.4.90.0090.05611.96
5.4.80.0100.05011.96
5.4.70.0120.04111.96
5.4.60.0070.04511.96
5.4.50.0110.04711.96
5.4.40.0100.04711.95
5.4.30.0050.03911.95
5.4.20.0090.03811.94
5.4.10.0080.03311.95
5.4.00.0050.03811.44

preferences:
35.08 ms | 400 KiB | 5 Q