3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user_string = "hallo worl, I wnt to ind a resturan in manhatn"; $subj = explode(" ", $user_string); $str = ["hello", "world", "I", "want", "to", "a", "in" , "find", "eat", "restaurant", "pizza", "Manhattan"]; $minStr = ""; $minDis = PHP_INT_MAX; foreach ($str as $curStr) { Foreach($subj as $word){ $dis = levenshtein($word, $curStr); $dist[$word][$dis][] = $curStr; } } foreach($dist as $key => $word){ echo "the closest word to " . $key . " is " . implode(" and ", $word[min(array_keys($word))]) . "\n"; $sentence[] = implode(" and ", $word[min(array_keys($word))]); } Echo "\n\nUser probably meant: '" .implode(" ", $sentence) . "'";

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.5.10.0100.00816.55
8.5.00.0110.01020.18
8.4.150.0030.00014.05
8.4.140.0100.01020.35
8.4.130.0120.00917.74
8.4.120.0100.00920.70
8.4.110.0110.00822.42
8.4.100.0060.00317.77
8.4.90.0130.01118.59
8.4.80.0070.01117.71
8.4.70.0120.00919.50
8.4.60.0110.00919.63
8.4.50.0090.00719.22
8.4.40.0070.01417.80
8.4.30.0170.00317.77
8.4.20.0030.01319.58
8.4.10.0050.00520.66
8.3.280.0090.01118.26
8.3.270.0120.00616.82
8.3.260.0120.00716.73
8.3.250.0070.00218.78
8.3.240.0030.00516.78
8.3.230.0090.01016.87
8.3.220.0110.00817.00
8.3.210.0090.00616.44
8.3.200.0120.00816.51
8.3.190.0100.01417.22
8.3.180.0100.00916.60
8.3.170.0160.00316.82
8.3.160.0070.01318.30
8.3.150.0150.00317.07
8.3.140.0090.00917.07
8.3.130.0060.00318.64
8.3.120.0160.00318.85
8.3.110.0030.00620.94
8.3.100.0140.00724.06
8.3.90.0070.00026.77
8.3.80.0000.00918.56
8.3.70.0080.00818.30
8.3.60.0060.00918.56
8.3.50.0170.00318.36
8.3.40.0090.00618.67
8.3.30.0070.01018.67
8.3.20.0040.00419.15
8.3.10.0060.00321.78
8.3.00.0080.00017.93
8.2.290.0040.00420.61
8.2.280.0060.00220.11
8.2.270.0110.00716.54
8.2.260.0050.00318.86
8.2.250.0080.00018.47
8.2.240.0050.00517.29
8.2.230.0040.00422.58
8.2.220.0080.00037.54
8.2.210.0110.00426.77
8.2.200.0070.01016.50
8.2.190.0070.00716.63
8.2.180.0120.00618.41
8.2.170.0090.00622.96
8.2.160.0120.00319.17
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00419.83
8.2.120.0000.00726.35
8.2.110.0110.01119.21
8.2.100.0000.01517.78
8.2.90.0040.00717.75
8.2.80.0030.00618.81
8.2.70.0040.00418.04
8.2.60.0000.00818.05
8.2.50.0060.00318.10
8.2.40.0000.00819.30
8.2.30.0000.00719.46
8.2.20.0030.00618.05
8.2.10.0000.00718.14
8.2.00.0030.00519.50
8.1.330.0090.01123.49
8.1.320.0120.00716.03
8.1.310.0040.01117.05
8.1.300.0100.00716.13
8.1.290.0090.00030.84
8.1.280.0040.01125.92
8.1.270.0040.00422.19
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00622.25
8.1.230.0040.00718.99
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0040.00417.23
8.1.190.0030.00617.22
8.1.180.0050.00318.10
8.1.170.0050.00318.59
8.1.160.0070.00318.97
8.1.150.0070.00018.82
8.1.140.0000.00717.90
8.1.130.0040.00419.03
8.1.120.0040.00417.48
8.1.110.0000.00817.42
8.1.100.0040.00417.42
8.1.90.0050.00317.43
8.1.80.0060.00317.48
8.1.70.0040.00417.37
8.1.60.0040.00417.60
8.1.50.0090.00017.46
8.1.40.0040.00417.47
8.1.30.0060.00317.70
8.1.20.0130.00017.61
8.1.10.0040.00417.57
8.1.00.0090.00017.53
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0050.00318.47
8.0.270.0050.00317.32
8.0.260.0030.00317.27
8.0.250.0030.00316.89
8.0.240.0070.00016.96
8.0.230.0080.00016.91
8.0.220.0050.00316.81
8.0.210.0050.00316.82
8.0.200.0050.00216.95
8.0.190.0040.00416.96
8.0.180.0040.00416.80
8.0.170.0000.00916.96
8.0.160.0030.00716.89
8.0.150.0030.00516.78
8.0.140.0040.00416.81
8.0.130.0000.00513.35
8.0.120.0050.00316.81
8.0.110.0000.00716.98
8.0.100.0000.00716.98
8.0.90.0040.00416.93
8.0.80.0090.00616.92
8.0.70.0040.00416.75
8.0.60.0040.00416.95
8.0.50.0040.00416.98
8.0.30.0090.01117.15
8.0.20.0080.01117.40
8.0.10.0000.00816.97
8.0.00.0090.01316.89
7.4.330.0000.00515.55
7.4.320.0060.00016.55
7.4.300.0070.00016.63
7.4.290.0030.00316.59
7.4.280.0060.00316.63
7.4.270.0040.00416.53
7.4.260.0030.00316.62
7.4.250.0040.00416.63
7.4.240.0030.00616.54
7.4.230.0000.00716.38
7.4.220.0030.00616.37
7.4.210.0090.00616.65
7.4.200.0000.00716.41
7.4.160.0060.00916.52
7.4.140.0140.00517.86
7.4.130.0120.00616.63
7.4.120.0100.01116.55
7.4.110.0060.01016.49
7.4.100.0120.00616.40
7.4.90.0070.01016.39
7.4.80.0090.00919.39
7.4.70.0060.01116.48
7.4.60.0030.01316.61
7.4.50.0100.00716.47
7.4.40.0130.00616.41
7.4.00.0060.00915.00
7.3.330.0050.00013.09
7.3.320.0020.00213.09
7.3.310.0000.00716.49
7.3.300.0070.00016.37
7.3.290.0000.00716.18
7.3.280.0060.00916.40
7.3.260.0100.00816.45
7.3.240.0100.00616.45
7.3.230.0100.01016.50
7.3.210.0070.01016.54
7.3.200.0060.01116.30
7.3.190.0090.00916.25
7.3.180.0090.01216.35
7.3.170.0120.00616.46
7.3.160.0140.00316.39
7.3.120.0030.01314.54
7.3.110.0060.01015.09
7.3.100.0120.00614.77
7.3.90.0030.01015.03
7.3.80.0070.00715.11
7.3.70.0050.00514.64
7.3.60.0080.00314.90
7.3.50.0030.01214.78
7.3.40.0060.00614.82
7.3.30.0070.00414.79
7.3.20.0140.00016.60
7.3.10.0040.00516.56
7.3.00.0070.00516.64
7.2.330.0140.01016.56
7.2.320.0080.00816.81
7.2.310.0090.01216.63
7.2.300.0100.00716.57
7.2.290.0070.01416.47
7.2.250.0060.00315.03
7.2.240.0100.00714.80
7.2.230.0090.00314.84
7.2.220.0150.00315.29
7.2.210.0040.01114.98
7.2.200.0030.00615.07
7.2.190.0070.00715.05
7.2.180.0090.00615.12
7.2.170.0030.01015.17
7.2.160.0060.00315.31
7.2.150.0070.00716.93
7.2.140.0060.01216.79
7.2.130.0020.01116.98
7.2.120.0080.00816.90
7.2.110.0060.00816.79
7.2.100.0040.00716.86
7.2.90.0070.00717.01
7.2.80.0050.01016.93
7.2.70.0080.00516.91
7.2.60.0040.01316.82
7.2.50.0030.01216.85
7.2.40.0700.00817.36
7.2.30.0470.00717.25
7.2.20.0540.00817.25
7.2.10.0700.00617.37
7.2.00.0530.01017.42
7.1.330.0030.01215.76
7.1.320.0070.00715.77
7.1.310.0030.01015.80
7.1.300.0040.00815.68
7.1.290.0030.01015.80
7.1.280.0100.00315.80
7.1.270.0000.00915.99
7.1.260.0110.00416.05
7.1.250.0060.00715.84
7.1.240.0070.01015.79
7.1.230.0000.01315.68
7.1.220.0000.01415.74
7.1.210.0070.00715.82
7.1.200.0100.00715.98
7.1.190.0110.00315.84
7.1.180.0030.01315.54
7.1.170.0120.00615.92
7.1.160.0680.00916.34
7.1.150.0590.00716.38
7.1.140.0830.00816.30
7.1.130.0740.00816.13
7.1.120.0750.00716.20
7.1.110.0660.00815.93
7.1.100.0670.01216.13
7.1.90.0760.00915.96
7.1.80.0880.00716.00
7.1.70.0850.00615.73
7.1.60.0980.00824.58
7.1.50.0660.00824.46
7.1.40.0630.01024.27
7.1.30.0640.01124.38
7.1.20.0630.01124.37
7.1.10.0930.00915.23
7.1.00.0920.01015.21
7.0.330.0100.00015.21
7.0.320.0090.00615.13
7.0.310.0080.00315.33
7.0.300.0000.01515.25
7.0.290.0080.00015.36
7.0.280.0040.00715.38
7.0.270.0040.00415.14
7.0.260.0070.00715.46
7.0.250.0030.00915.46
7.0.240.0000.01415.46
7.0.230.0070.00715.48
7.0.220.0050.00315.43
7.0.210.0000.01415.36
7.0.200.0090.00615.52
7.0.190.0070.00715.56
7.0.180.0000.01515.32
7.0.170.0040.00415.32
7.0.160.0030.00515.19
7.0.150.0040.00815.50
7.0.140.0030.01015.42
7.0.130.0100.00615.47
7.0.120.0050.00515.36
7.0.110.0110.00715.32
7.0.100.0030.00615.36
7.0.90.0070.00415.52
7.0.80.0070.01015.21
7.0.70.0090.00615.20
7.0.60.0030.01015.47
7.0.50.0030.00615.64
7.0.40.0070.00713.50
7.0.30.0070.00713.61
7.0.20.0090.00313.48
7.0.10.0060.00613.57
7.0.00.0030.00713.46
5.6.400.0070.01014.46
5.6.390.0050.00514.56
5.6.380.0090.00914.57
5.6.370.0060.00914.50
5.6.360.0030.01614.52
5.6.350.0000.01414.68
5.6.340.0090.00614.17
5.6.330.0000.00914.38
5.6.320.0070.00714.44
5.6.310.0060.00914.31
5.6.300.0150.00014.41
5.6.290.0060.00914.41
5.6.280.0060.00914.29
5.6.270.0110.00814.59
5.6.260.0040.00414.62
5.6.250.0030.00914.31
5.6.240.0030.01014.33
5.6.230.0000.01314.40
5.6.220.0000.00914.50
5.6.210.0000.00914.21
5.6.200.0060.00614.75
5.6.190.0070.00714.38
5.6.180.0000.00814.41
5.6.170.0030.01014.33
5.6.160.0080.00414.77
5.6.150.0040.00714.45
5.6.140.0080.00414.44
5.6.130.0070.01014.69
5.6.120.0040.01114.43
5.6.110.0000.01314.61
5.6.100.0070.00714.16
5.6.90.0030.01214.89
5.6.80.0060.00614.56
5.6.70.0070.00714.24
5.6.60.0030.01014.40
5.6.50.0000.01414.23
5.6.40.0040.01114.70
5.6.30.0070.01014.21
5.6.20.0000.01214.25
5.6.10.0000.01414.39
5.6.00.0030.01014.34

preferences:
18.06 ms | 403 KiB | 5 Q