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("http://zyzzyva.net/lexicons/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.0070.01316.50
8.3.50.0130.00319.57
8.3.40.0070.01018.68
8.3.30.0100.00319.04
8.3.20.0050.00220.38
8.3.10.0080.00023.83
8.3.00.0040.00417.38
8.2.180.0140.00716.63
8.2.170.0030.01022.96
8.2.160.0070.00720.52
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00421.09
8.2.110.0070.00322.30
8.2.100.0070.00417.78
8.2.90.0040.00419.09
8.2.80.0050.00317.97
8.2.70.0060.00317.50
8.2.60.0040.00417.53
8.2.50.0030.00618.07
8.2.40.0030.00618.09
8.2.30.0000.00917.86
8.2.20.0000.00717.51
8.2.10.0040.00417.88
8.2.00.0000.00817.49
8.1.280.0110.00425.92
8.1.270.0060.00323.92
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0030.00623.82
8.1.230.0070.00319.16
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0030.00617.00
8.1.190.0080.00017.10
8.1.180.0080.00018.10
8.1.170.0040.00418.48
8.1.160.0000.00721.84
8.1.150.0000.00718.71
8.1.140.0040.00417.25
8.1.130.0030.00317.67
8.1.120.0040.00417.25
8.1.110.0000.00717.22
8.1.100.0050.00317.19
8.1.90.0000.00717.24
8.1.80.0070.00017.34
8.1.70.0070.00017.30
8.1.60.0060.00317.47
8.1.50.0000.00817.38
8.1.40.0000.00717.35
8.1.30.0080.00017.40
8.1.20.0030.00617.35
8.1.10.0040.00417.36
8.1.00.0040.00417.23
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0000.00618.34
8.0.270.0040.00417.16
8.0.260.0030.00317.04
8.0.250.0000.00716.86
8.0.240.0040.00416.97
8.0.230.0000.00616.90
8.0.220.0040.00416.91
8.0.210.0070.00016.76
8.0.200.0000.00616.91
8.0.190.0030.00316.95
8.0.180.0030.00516.92
8.0.170.0000.00716.93
8.0.160.0040.00416.85
8.0.150.0000.00716.69
8.0.140.0000.00716.84
8.0.130.0070.00013.35
8.0.120.0040.00416.79
8.0.110.0000.00716.87
8.0.100.0040.00416.85
8.0.90.0050.00216.82
8.0.80.0100.01016.76
8.0.70.0020.00516.68
8.0.60.0040.00416.76
8.0.50.0040.00416.80
8.0.30.0080.01217.04
8.0.20.0090.01017.40
8.0.10.0000.00716.76
8.0.00.0080.01316.65
7.4.330.0000.00515.00
7.4.320.0060.00016.50
7.4.300.0030.00516.37
7.4.290.0030.00316.29
7.4.280.0000.00716.52
7.4.270.0000.00716.48
7.4.260.0040.00416.38
7.4.250.0000.00816.45
7.4.240.0020.00516.46
7.4.230.0030.00316.57
7.4.220.0120.00616.58
7.4.210.0030.01016.44
7.4.200.0000.00716.30
7.4.160.0040.01116.35
7.4.150.0120.00617.40
7.4.140.0050.01217.86
7.4.130.0100.00716.59
7.4.120.0120.00716.36
7.4.110.0160.00616.35
7.4.100.0110.00716.43
7.4.90.0160.00616.48
7.4.80.0050.01119.39
7.4.70.0120.00616.41
7.4.60.0080.00816.38
7.4.50.0040.00416.25
7.4.40.0070.01016.43
7.4.30.0140.00716.39
7.4.00.0030.01414.94
7.3.330.0060.00313.29
7.3.320.0050.00013.30
7.3.310.0060.00316.34
7.3.300.0000.00716.24
7.3.290.0000.01416.27
7.3.280.0100.00616.30
7.3.270.0090.01817.40
7.3.260.0030.01516.21
7.3.240.0060.01016.42
7.3.230.0110.00816.39
7.3.210.0060.01116.29
7.3.200.0060.01319.39
7.3.190.0060.00916.23
7.3.180.0130.00316.29
7.3.170.0060.00916.47
7.3.160.0080.00816.32
7.2.330.0120.01216.33
7.2.320.0120.00616.48
7.2.310.0070.01016.48
7.2.300.0120.00816.75
7.2.290.0090.00616.67
7.1.100.0040.00818.07
7.1.70.0060.00916.75
7.1.60.0070.01819.40
7.1.50.0100.00716.91
7.1.00.0030.07322.45
7.0.200.0090.00016.79
7.0.140.0070.06321.97
7.0.110.0030.08719.95
7.0.100.0170.04019.96
7.0.90.0530.08319.98
7.0.80.0530.08320.05
7.0.70.0630.05319.92
7.0.60.0570.09019.91
7.0.50.0200.07720.50
7.0.40.0030.08020.25
7.0.30.0100.07720.25
7.0.20.0100.05020.16
7.0.10.0130.07320.05
7.0.00.0130.07319.99
5.6.280.0130.06321.01
5.6.260.0070.08320.64
5.6.250.0200.06320.67
5.6.240.0070.07720.60
5.6.230.0100.07320.70
5.6.220.0000.08020.66
5.6.210.0170.06320.70
5.6.200.0030.08021.20
5.6.190.0170.07721.21
5.6.180.0170.07321.30
5.6.170.0070.08320.96
5.6.160.0070.07321.08
5.6.150.0030.08021.07
5.6.140.0030.08721.06
5.6.130.0100.08321.15
5.6.120.0170.07021.21
5.6.110.0200.07721.09
5.6.100.0070.08320.95
5.6.90.0000.05721.02
5.6.80.0100.07020.55
5.6.70.0130.07720.54
5.6.60.0170.06320.48
5.6.50.0070.08020.36
5.6.40.0130.04320.42
5.6.30.0170.07020.40
5.6.20.0030.08020.65
5.6.10.0100.08020.51
5.6.00.0070.07320.50
5.5.380.0130.07020.48
5.5.370.0030.07320.43
5.5.360.0070.07720.25
5.5.350.0000.07720.48
5.5.340.0000.04720.92
5.5.330.0100.05020.79
5.5.320.0130.05320.83
5.5.310.0100.07720.83
5.5.300.0130.06720.97
5.5.290.0030.07720.68
5.5.280.0070.08320.91
5.5.270.0070.08020.82
5.5.260.0170.08020.91
5.5.250.0070.08320.79
5.5.240.0070.08720.37
5.5.230.0100.08320.34
5.5.220.0070.08020.16
5.5.210.0070.07320.18
5.5.200.0130.07320.20
5.5.190.0130.04320.32
5.5.180.0100.07020.38
5.5.160.0070.05320.18
5.5.150.0130.06020.27
5.5.140.0100.07320.17
5.5.130.0200.03320.23
5.5.120.0130.07020.38
5.5.110.0100.07720.39
5.5.100.0100.08020.21
5.5.90.0030.08020.00
5.5.80.0170.06720.00
5.5.70.0130.07320.05
5.5.60.0100.07720.17
5.5.50.0100.07720.03
5.5.40.0170.06720.18
5.5.30.0030.08020.25
5.5.20.0130.05720.25
5.5.10.0030.08020.05
5.5.00.0070.07020.23
5.4.450.0130.08019.36
5.4.440.0070.07319.51
5.4.430.0100.06719.56
5.4.420.0100.07719.27
5.4.410.0100.07319.21
5.4.400.0130.06719.01
5.4.390.0130.06719.19
5.4.380.0130.04719.04
5.4.370.0130.07019.16
5.4.360.0100.07319.24
5.4.350.0030.06019.27
5.4.340.0070.07019.23
5.4.320.0270.05319.09
5.4.310.0000.08018.98
5.4.300.0170.05719.16
5.4.290.0070.07019.24
5.4.280.0070.07719.01
5.4.270.0100.07019.18
5.4.260.0000.06319.03
5.4.250.0000.07318.99
5.4.240.0070.06018.94
5.4.230.0070.08019.18
5.4.220.0130.05318.96
5.4.210.0000.08018.97
5.4.200.0000.06319.21
5.4.190.0100.04019.00
5.4.180.0030.07719.23
5.4.170.0170.07019.23
5.4.160.0130.05718.88
5.4.150.0070.03719.29
5.4.140.0070.03716.68
5.4.130.0100.07016.39
5.4.120.0030.05316.58
5.4.110.0030.08016.56
5.4.100.0070.06716.42
5.4.90.0100.07016.31
5.4.80.0000.07716.59
5.4.70.0100.04316.52
5.4.60.0030.07716.64
5.4.50.0070.04016.38
5.4.40.0030.07016.44
5.4.30.0070.07316.54
5.4.20.0130.06016.41
5.4.10.0030.06716.41
5.4.00.0000.06015.89
5.3.290.0070.08014.74
5.3.280.0200.06014.76
5.3.270.0200.06314.62
5.3.260.0100.07014.76
5.3.250.0100.03314.71
5.3.240.0030.07014.60
5.3.230.0030.08014.64
5.3.220.0200.05014.71
5.3.210.0030.08014.58
5.3.200.0000.07714.54
5.3.190.0100.06714.59
5.3.180.0130.05014.59
5.3.170.0030.06314.59
5.3.160.0070.07714.72
5.3.150.0070.05314.55
5.3.140.0130.05314.59
5.3.130.0070.06714.57
5.3.120.0070.07014.54
5.3.110.0130.06314.79
5.3.100.0030.08014.02
5.3.90.0070.07714.03
5.3.80.0000.04714.05
5.3.70.0070.07014.05
5.3.60.0030.05714.01
5.3.50.0100.03714.01
5.3.40.0130.06314.11
5.3.30.0030.06314.07
5.3.20.0070.07713.73
5.3.10.0100.03713.72
5.3.00.0070.07013.90
5.2.170.0100.05312.84
5.2.160.0100.05712.84
5.2.150.0070.06012.84
5.2.140.0030.05712.84
5.2.130.0000.06312.84
5.2.120.0030.06312.84
5.2.110.0070.06312.84
5.2.100.0070.03312.84
5.2.90.0030.06012.84
5.2.80.0100.04312.84
5.2.70.0030.05312.84
5.2.60.0070.05712.84
5.2.50.0070.06312.84
5.2.40.0030.05712.84
5.2.30.0070.06712.84
5.2.20.0070.05712.84
5.2.10.0030.05312.84
5.2.00.0030.04712.84
5.1.60.0000.03312.84
5.1.50.0030.05712.84
5.1.40.0030.04712.84
5.1.30.0070.05012.84
5.1.20.0070.05312.84
5.1.10.0000.03312.84
5.1.00.0030.05712.84
5.0.50.0100.02012.84
5.0.40.0000.04712.84
5.0.30.0070.05012.84
5.0.20.0030.02312.84
5.0.10.0030.02012.84
5.0.00.0070.05312.84
4.4.90.0030.02012.84
4.4.80.0000.03312.84
4.4.70.0100.03012.84
4.4.60.0000.02712.84
4.4.50.0030.03312.84
4.4.40.0070.04312.84
4.4.30.0070.03012.84
4.4.20.0030.03312.84
4.4.10.0030.02312.84
4.4.00.0070.04712.84
4.3.110.0070.03012.84
4.3.100.0130.02012.84
4.3.90.0000.01712.84
4.3.80.0030.05012.84
4.3.70.0030.03312.84
4.3.60.0030.03312.84
4.3.50.0000.03712.84
4.3.40.0070.04012.84
4.3.30.0000.02712.84
4.3.20.0000.03712.84
4.3.10.0000.03712.84
4.3.00.0000.02012.84

preferences:
60.92 ms | 400 KiB | 5 Q