3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testStrings = [ "H3||0", "Hallo", "aloha", "h", "hallo", "hallå", "hel", "helicopter", "hellacious", "hello", "hello y'all", "hello yall", "helów", "hey hello", "hola", "hêllo", "mellow yellow", "try", ]; $needle = 'hello'; usort($testStrings, function($a, $b) use ($needle) { return levenshtein($needle, $a) <=> levenshtein($needle, $b) ?: similar_text($needle, $b) <=> similar_text($needle, $a); }); var_export($testStrings);

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.0120.00318.43
8.3.50.0120.00316.46
8.3.40.0120.00318.67
8.3.30.0110.00418.63
8.3.20.0090.00024.18
8.3.10.0030.00524.66
8.3.00.0040.00426.16
8.2.180.0110.00725.92
8.2.170.0150.00018.84
8.2.160.0150.00322.96
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0040.00720.92
8.2.100.0040.00817.72
8.2.90.0040.00417.63
8.2.80.0030.00718.66
8.2.70.0040.00417.63
8.2.60.0000.00817.38
8.2.50.0040.00418.03
8.2.40.0040.00419.23
8.2.30.0000.00719.33
8.2.20.0000.00718.18
8.2.10.0050.00319.23
8.2.00.0000.00719.32
8.1.280.0120.00325.92
8.1.270.0000.00724.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00320.87
8.1.230.0040.00817.77
8.1.220.0000.00817.75
8.1.210.0080.00018.77
8.1.200.0050.00517.48
8.1.190.0000.00817.00
8.1.180.0070.00318.10
8.1.170.0000.00817.62
8.1.160.0030.00518.91
8.1.150.0000.00718.91
8.1.140.0070.00018.90
8.1.130.0030.00320.32
8.1.120.0070.00017.52
8.1.110.0050.00317.48
8.1.100.0030.00517.44
8.1.90.0000.00717.42
8.1.80.0000.00817.47
8.1.70.0030.00317.51
8.1.60.0030.00517.44
8.1.50.0050.00317.57
8.1.40.0000.00817.55
8.1.30.0000.00817.56
8.1.20.0040.00417.66
8.1.10.0000.00817.54
8.1.00.0000.00817.45
8.0.300.0040.00418.87
8.0.290.0060.00316.75
8.0.280.0000.00918.43
8.0.270.0050.00316.87
8.0.260.0000.00718.66
8.0.250.0030.00317.04
8.0.240.0040.00416.93
8.0.230.0030.00516.92
8.0.220.0030.00316.82
8.0.210.0000.00716.96
8.0.200.0000.00716.92
8.0.190.0040.00416.95
8.0.180.0070.00316.94
8.0.170.0080.00016.91
8.0.160.0040.00416.72
8.0.150.0030.00616.76
8.0.140.0050.00216.74
8.0.130.0000.00713.36
8.0.120.0030.00616.89
8.0.110.0000.00716.80
8.0.100.0040.00416.76
8.0.90.0030.00516.85
8.0.80.0090.00916.92
8.0.70.0090.01816.93
8.0.60.0110.00416.78
8.0.50.0090.00616.87
8.0.30.0170.00316.89
8.0.20.0030.01716.85
8.0.10.0120.00317.06
8.0.00.0000.01516.97
7.4.330.0060.00015.55
7.4.320.0030.00316.48
7.4.300.0030.00316.59
7.4.290.0020.00716.55
7.4.280.0000.00716.61
7.4.270.0000.00716.52
7.4.260.0050.00013.30
7.4.250.0040.00416.46
7.4.240.0050.00316.56
7.4.230.0000.00716.50
7.4.220.0070.00016.43
7.4.210.0150.01516.64
7.4.200.0130.01016.46
7.4.190.0140.01216.69
7.4.180.0110.01416.64
7.4.160.0080.01116.55
7.4.150.0070.00716.52
7.4.140.0100.00616.51
7.4.130.0100.01016.41
7.4.120.0130.00716.55
7.4.110.0130.00316.38
7.4.100.0170.01016.55
7.4.90.0130.01616.47
7.4.80.0040.01116.41
7.4.70.0120.01216.51
7.4.60.0110.00916.41
7.4.50.0150.01116.37
7.4.40.0160.00916.36
7.4.30.0100.01016.50
7.4.20.0200.00716.54
7.4.10.0080.00816.70
7.4.00.0120.01216.49
7.3.330.0040.00416.11
7.3.320.0000.00513.29
7.3.310.0030.00316.35
7.3.300.0000.00716.27
7.3.290.0040.00816.24
7.3.280.0070.01016.25
7.3.270.0070.01116.19
7.3.260.0090.01216.42
7.3.250.0130.00416.32
7.3.240.0070.00716.29
7.3.230.0100.01316.28
7.3.220.0130.00316.23
7.3.210.0060.01216.21
7.3.200.0070.01116.26
7.3.190.0090.00616.25
7.3.180.0100.01016.21
7.3.170.0060.00916.14
7.3.160.0060.01016.26
7.3.150.0130.01416.16
7.3.140.0090.00916.25
7.3.130.0140.00316.31
7.3.120.0070.01016.23
7.3.110.0320.01516.20
7.3.100.0120.00616.23
7.3.90.0130.00316.42
7.3.80.0070.01016.27
7.3.70.0070.01416.33
7.3.60.0120.00616.39
7.3.50.0120.00316.42
7.3.40.0100.01616.42
7.3.30.0220.00316.43
7.3.20.0100.00716.42
7.3.10.0410.01016.34
7.3.00.0140.00016.41

preferences:
58.17 ms | 400 KiB | 5 Q