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)
5.4.310.0050.04212.52
5.4.300.0120.03112.52
5.4.290.0060.04412.51
5.4.280.0050.03612.41
5.4.270.0110.03112.41
5.4.260.0050.03912.41
5.4.250.0050.05012.41
5.4.240.0040.05012.41
5.4.230.0060.03812.40
5.4.220.0050.05412.40
5.4.210.0090.03612.40
5.4.200.0070.04212.40
5.4.190.0060.03612.40
5.4.180.0080.03412.40
5.4.170.0060.03612.40
5.4.160.0050.03712.40
5.4.150.0060.03712.40
5.4.140.0060.03812.09
5.4.130.0040.03812.07
5.4.120.0060.03712.03
5.4.110.0100.04012.03
5.4.100.0070.04312.03
5.4.90.0080.03812.03
5.4.80.0060.03812.03
5.4.70.0030.03912.03
5.4.60.0040.03712.03
5.4.50.0050.03812.03
5.4.40.0040.03912.02
5.4.30.0070.04212.01
5.4.20.0050.03912.00
5.4.10.0080.04912.01
5.4.00.0070.05111.50
5.3.290.0070.03912.80
5.3.280.0100.06212.71
5.3.270.0080.05012.72
5.3.260.0030.04312.72
5.3.250.0100.05012.71
5.3.240.0090.05112.71
5.3.230.0130.05412.71
5.3.220.0060.05012.68
5.3.210.0100.05112.68
5.3.200.0060.04212.68
5.3.190.0070.04412.68
5.3.180.0080.05212.67
5.3.170.0050.05512.67
5.3.160.0070.05012.67
5.3.150.0040.04012.67
5.3.140.0060.03712.66
5.3.130.0110.03712.65
5.3.120.0090.05512.65
5.3.110.0060.04612.66
5.3.100.0070.03912.13
5.3.90.0070.03912.11
5.3.80.0070.03612.09
5.3.70.0060.03712.09
5.3.60.0090.04512.08
5.3.50.0090.04712.02
5.3.40.0090.04712.02
5.3.30.0090.04611.98
5.3.20.0050.05411.77
5.3.10.0060.05111.73
5.3.00.0080.03711.72
5.2.170.0060.0439.21
5.2.160.0070.0289.21
5.2.150.0050.0359.21
5.2.140.0040.0359.21
5.2.130.0080.0279.17
5.2.120.0080.0299.17
5.2.110.0060.0299.18
5.2.100.0080.0279.18
5.2.90.0060.0409.18
5.2.80.0120.0449.18
5.2.70.0110.0379.17
5.2.60.0050.0369.13
5.2.50.0060.0299.10
5.2.40.0020.0329.07
5.2.30.0050.0309.05
5.2.20.0070.0329.04
5.2.10.0050.0328.95
5.2.00.0030.0348.81
5.1.60.0060.0228.09
5.1.50.0030.0298.09
5.1.40.0030.0278.06
5.1.30.0070.0248.43
5.1.20.0070.0298.44
5.1.10.0060.0268.17
5.1.00.0060.0268.17
5.0.50.0030.0226.64
5.0.40.0050.0226.51
5.0.30.0050.0386.31
5.0.20.0040.0266.29
5.0.10.0050.0266.27
5.0.00.0050.0386.26
4.4.90.0030.0214.77
4.4.80.0030.0214.75
4.4.70.0020.0214.76
4.4.60.0010.0174.75
4.4.50.0030.0214.77
4.4.40.0030.0334.71
4.4.30.0040.0144.76
4.4.20.0030.0214.84
4.4.10.0050.0144.85
4.4.00.0060.0294.76
4.3.110.0040.0214.67
4.3.100.0010.0234.66
4.3.90.0040.0144.63
4.3.80.0040.0314.58
4.3.70.0000.0184.63
4.3.60.0040.0144.63
4.3.50.0030.0154.62
4.3.40.0050.0314.54
4.3.30.0030.0223.30
4.3.20.0020.0163.27
4.3.10.0030.0153.24
4.3.00.0030.01315.94

preferences:
135.76 ms | 1394 KiB | 7 Q