3v4l.org

run code in 300+ PHP versions simultaneously
<?php function 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.70.0060.01218.30
8.3.60.0070.01118.68
8.3.50.0100.00921.85
8.3.40.0140.00318.84
8.3.30.0070.00719.11
8.3.20.0040.00420.33
8.3.10.0070.00021.81
8.3.00.0000.00819.38
8.2.180.0040.01816.63
8.2.170.0070.00722.96
8.2.160.0140.00020.47
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.12
8.2.110.0060.00319.11
8.2.100.0040.00817.50
8.2.90.0060.00319.00
8.2.80.0050.00317.97
8.2.70.0040.00417.25
8.2.60.0000.00817.79
8.2.50.0060.00318.07
8.2.40.0000.00918.03
8.2.30.0050.00217.96
8.2.20.0070.00017.49
8.2.10.0080.00017.93
8.2.00.0040.00417.63
8.1.280.0120.00625.92
8.1.270.0060.00320.51
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00923.88
8.1.230.0060.00617.42
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0060.00320.36
8.1.160.0000.00721.79
8.1.150.0000.00718.60
8.1.140.0000.00717.36
8.1.130.0040.00417.75
8.1.120.0040.00417.22
8.1.110.0000.00717.39
8.1.100.0040.00417.34
8.1.90.0050.00217.23
8.1.80.0000.00717.19
8.1.70.0030.00317.33
8.1.60.0060.00317.43
8.1.50.0080.00017.33
8.1.40.0000.00817.29
8.1.30.0060.00317.50
8.1.20.0070.00017.55
8.1.10.0040.00417.32
8.1.00.0040.00417.36
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0070.00018.41
8.0.270.0030.00317.17
8.0.260.0030.00317.07
8.0.250.0040.00416.99
8.0.240.0000.00616.81
8.0.230.0030.00616.82
8.0.220.0040.00416.76
8.0.210.0040.00416.74
8.0.200.0070.00016.86
8.0.190.0030.00516.95
8.0.180.0000.00816.86
8.0.170.0040.00416.79
8.0.160.0000.00716.82
8.0.150.0030.00516.71
8.0.140.0070.00016.72
8.0.130.0040.00413.30
8.0.120.0000.00816.88
8.0.110.0020.00516.68
8.0.100.0040.00416.72
8.0.90.0000.00816.73
8.0.80.0070.01316.82
8.0.70.0040.00416.81
8.0.60.0040.00416.68
8.0.50.0050.00316.75
8.0.30.0130.00917.01
8.0.20.0210.01917.40
8.0.10.0050.00316.91
8.0.00.0120.00616.74
7.4.330.0000.00515.03
7.4.320.0070.00016.40
7.4.300.0050.00216.38
7.4.290.0050.00316.46
7.4.280.0040.00416.39
7.4.270.0000.00716.38
7.4.260.0000.00716.37
7.4.250.0000.00716.40
7.4.240.0010.00616.50
7.4.230.0030.00316.18
7.4.220.0150.01016.43
7.4.210.0110.00316.43
7.4.200.0000.00716.45
7.4.160.0030.01216.22
7.4.150.0130.00317.40
7.4.140.0080.01417.86
7.4.130.0110.01116.32
7.4.120.0080.00916.28
7.4.110.0180.00616.50
7.4.100.0100.00716.50
7.4.90.0090.00916.39
7.4.80.0150.00319.39
7.4.70.0030.01316.48
7.4.60.0130.00316.48
7.4.50.0060.00316.36
7.4.40.0080.00816.67
7.4.30.0070.01016.61
7.4.00.0060.00614.89
7.3.330.0030.00313.13
7.3.320.0040.00713.27
7.3.310.0040.00416.17
7.3.300.0000.00716.15
7.3.290.0050.01016.21
7.3.280.0110.00816.33
7.3.270.0090.01317.40
7.3.260.0130.00316.31
7.3.250.0180.00316.31
7.3.240.0110.01216.19
7.3.230.0140.00716.41
7.3.210.0140.00316.30
7.3.200.0110.00619.39
7.3.190.0030.01316.12
7.3.180.0110.00516.15
7.3.170.0090.01316.28
7.3.160.0080.00816.27
7.2.330.0090.01316.68
7.2.320.0080.00816.58
7.2.310.0110.01116.57
7.2.300.0100.00616.61
7.2.290.0110.00716.34
7.2.00.0000.01619.21
7.1.100.0140.00618.09
7.1.70.0000.01217.04
7.1.60.0170.00719.50
7.1.50.0140.01116.76
7.1.00.0030.07722.45
7.0.200.0250.00016.64
7.0.140.0000.07722.21
7.0.60.0170.03719.84
7.0.50.0030.08317.89
7.0.40.0030.07720.30
7.0.30.0300.07720.07
7.0.20.0170.04020.10
7.0.10.0170.04020.23
7.0.00.0100.04020.12
5.6.280.0070.07021.00
5.6.210.0070.06020.48
5.6.200.0100.03718.28
5.6.190.0070.05020.59
5.6.180.0200.08720.61
5.6.170.0100.04720.57
5.6.160.0130.07320.52
5.6.150.0070.03718.16
5.6.140.0100.08018.19
5.6.130.0030.06718.25
5.6.120.0170.07321.13
5.6.110.0070.07321.13
5.6.100.0130.07321.05
5.6.90.0000.04720.98
5.6.80.0130.06720.39
5.6.70.0200.07720.49
5.5.350.0200.07720.41
5.5.340.0000.04318.09
5.5.330.0070.08320.44
5.5.320.0170.06720.19
5.5.310.0170.04020.36
5.5.300.0100.08018.01
5.5.290.0070.08017.94
5.5.280.0170.07020.96
5.5.270.0070.06320.83
5.5.260.0130.07020.74
5.5.250.0170.06320.70
5.5.240.0130.07320.04
5.4.450.0670.06319.74
5.4.440.0670.06019.58
5.4.430.0400.05719.16
5.4.420.0730.06019.38
5.4.410.0100.05319.35
5.4.400.0370.07018.85
5.4.390.0300.06018.74
5.4.380.0230.06018.76
5.4.370.0230.05718.69
5.4.360.0070.06718.57
5.4.350.1100.05018.58
5.4.340.1400.07018.59
5.4.320.0430.06318.71
5.4.310.0200.06318.79
5.4.300.0400.06718.80
5.4.290.0270.06018.49
5.4.280.0370.05018.79
5.4.270.0170.06018.71
5.4.260.0230.05718.56
5.4.250.0300.05018.79
5.4.240.0230.07018.73
5.4.230.0200.05318.48
5.4.220.0100.06718.56
5.4.210.0230.05718.49
5.4.200.0200.05716.61
5.4.190.0230.05318.70
5.4.180.0170.06718.68
5.4.170.0400.06018.73
5.4.160.0300.04718.74
5.4.150.0230.05718.65
5.4.140.0170.06316.29
5.4.130.0270.04316.36
5.4.120.0230.05716.27
5.4.110.0170.05316.42
5.4.100.0270.05316.45
5.4.90.0200.05716.16
5.4.80.0270.04716.40
5.4.70.0170.05716.34
5.4.60.0200.05716.23
5.4.50.0200.05016.18
5.4.40.0270.05016.25
5.4.30.0270.04316.17
5.4.20.0200.06016.27
5.4.10.0300.05016.29
5.4.00.0170.06315.78
5.3.290.0230.06014.73
5.3.280.0170.06314.68
5.3.270.0170.06014.66
5.3.260.0230.07014.80
5.3.250.0200.06314.68
5.3.240.0270.06714.75
5.3.230.0200.05714.60
5.3.220.0270.04714.57
5.3.210.1330.06314.63
5.3.200.0170.05714.80
5.3.190.1170.07014.73
5.3.180.0270.06714.71
5.3.170.0300.06014.76
5.3.160.0200.06714.69
5.3.150.0200.05714.56
5.3.140.0270.06314.71
5.3.130.0300.06314.61
5.3.120.0230.05714.79
5.3.110.0170.05714.58
5.3.100.1570.06014.07
5.3.90.0270.06314.03
5.3.80.1070.05314.17
5.3.70.0730.04714.08
5.3.60.0170.05314.07
5.3.50.0300.06713.96
5.3.40.1500.05713.96
5.3.30.0200.05713.97
5.3.20.0170.08013.89
5.3.10.0300.06713.80
5.3.00.0170.07713.87
5.2.170.0200.05011.25
5.2.160.0100.04711.24
5.2.150.0170.04711.27
5.2.140.0230.04311.25
5.2.130.0100.05711.12
5.2.120.0270.03011.20
5.2.110.0070.05311.11
5.2.100.0200.05311.14
5.2.90.0100.06311.23
5.2.80.0200.05711.22
5.2.70.0170.06011.15
5.2.60.0230.05011.09
5.2.50.0200.05311.03
5.2.40.0170.05311.22
5.2.30.0230.04711.03
5.2.20.0130.05310.95
5.2.10.0100.04711.00
5.2.00.0070.04710.74
5.1.60.0200.02710.07
5.1.50.0100.05010.05
5.1.40.0130.04310.19
5.1.30.0200.04010.38
5.1.20.0200.04010.41
5.1.10.0270.02310.27
5.1.00.0100.04010.27
5.0.50.0030.0378.61
5.0.40.0000.0378.52
5.0.30.0070.0578.28
5.0.20.0100.0378.34
5.0.10.0100.0378.30
5.0.00.0100.0538.30
4.4.90.0130.0235.92
4.4.80.0130.0275.94
4.4.70.0070.0305.91
4.4.60.0070.0335.89
4.4.50.0030.0375.99
4.4.40.0100.0435.99
4.4.30.0130.0235.91
4.4.20.0030.0275.96
4.4.10.0130.0206.00
4.4.00.0130.0376.02
4.3.110.0070.0305.84
4.3.100.0100.0235.92
4.3.90.0100.0235.85
4.3.80.0030.0405.81
4.3.70.0130.0175.87
4.3.60.0070.0205.81
4.3.50.0100.0205.84
4.3.40.0030.0375.77
4.3.30.0030.0234.57
4.3.20.0000.0274.59
4.3.10.0070.0204.55
4.3.00.0130.0206.99

preferences:
56.33 ms | 401 KiB | 5 Q