3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr= ["clownfish.jpg", "clownfish-150x150.jpg", "b800-768x575.jpg", "b800-4.jpg", "b800.jpg", "agility_3.jpg", "agility_3-45x45.jpg", "hundezubehör-für-sommer.jpg"]; $find = "hundezubehör-für-sommer.jpg"; var_dump(in_array($find, $arr)); Foreach($arr as $key => $item){ $length = min(strlen($item), strlen($find))-4; // lenght of the smallest string - ".jpg" if(levenshtein(substr($item,0,$length), substr($find,0,$length), 1,1,0) == 0){ //is it the same file $len = [strlen($item) => $item, strlen($find) => $find]; // make a associative array with lenght as key $minkey = min(array_keys($len)); // find the smallest of them $new[] = $len[$minkey]; // add the smallest to the new array } } Var_dump(array_unique($new)); // remove duplicates

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.4.120.0120.00820.68
8.4.110.0100.00924.14
8.4.100.0110.00917.72
8.4.90.0120.00917.83
8.4.80.0110.00917.80
8.4.70.0090.00217.78
8.4.60.0130.00718.70
8.4.50.0140.00719.44
8.4.40.0050.00317.68
8.4.30.0100.00719.49
8.4.20.0220.00018.62
8.4.10.0000.01017.80
8.3.250.0100.00818.89
8.3.240.0120.00916.44
8.3.230.0040.00516.84
8.3.220.0080.00619.05
8.3.210.0090.00916.83
8.3.200.0130.00716.56
8.3.190.0070.00819.18
8.3.180.0070.01116.86
8.3.170.0100.00718.89
8.3.160.0110.00418.22
8.3.150.0130.00720.40
8.3.140.0100.00616.63
8.3.130.0190.00318.21
8.3.120.0060.01219.02
8.3.110.0100.00720.94
8.3.100.0090.00024.06
8.3.90.0060.00326.77
8.3.80.0100.00016.50
8.3.70.0090.00918.43
8.3.60.0120.00918.61
8.3.50.0130.00717.94
8.3.40.0090.00618.67
8.3.30.0040.01518.71
8.3.20.0060.00318.82
8.3.10.0040.00421.90
8.3.00.0040.00421.60
8.2.290.0060.00220.43
8.2.280.0060.00420.30
8.2.270.0040.01418.95
8.2.260.0060.01218.09
8.2.250.0050.00316.70
8.2.240.0000.00817.04
8.2.230.0060.00322.58
8.2.220.0090.00037.54
8.2.210.0050.00326.77
8.2.200.0070.00316.50
8.2.190.0100.00716.58
8.2.180.0140.00725.92
8.2.170.0040.01118.81
8.2.160.0110.00322.96
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00419.25
8.2.110.0070.00322.25
8.2.100.0090.00317.84
8.2.90.0080.00017.84
8.2.80.0000.00819.21
8.2.70.0080.00018.03
8.2.60.0040.00418.22
8.2.50.0060.00318.10
8.2.40.0030.00619.47
8.2.30.0080.00020.63
8.2.20.0040.00418.17
8.2.10.0000.00818.18
8.2.00.0000.00819.53
8.1.330.0100.00916.70
8.1.320.0130.00716.10
8.1.310.0120.00616.73
8.1.300.0120.00618.59
8.1.290.0090.00030.84
8.1.280.0070.00725.92
8.1.270.0040.00420.17
8.1.260.0000.00726.35
8.1.250.0100.00728.09
8.1.240.0090.00623.97
8.1.230.0030.01022.64
8.1.220.0000.00817.78
8.1.210.0050.00318.77
8.1.200.0040.00717.35
8.1.190.0040.00417.22
8.1.180.0080.00018.10
8.1.170.0060.00318.46
8.1.160.0040.00418.96
8.1.150.0030.00518.88
8.1.140.0040.00418.93
8.1.130.0040.00417.36
8.1.120.0030.00417.40
8.1.110.0040.00417.43
8.1.100.0050.00217.46
8.1.90.0000.00717.46
8.1.80.0080.00017.50
8.1.70.0030.00317.48
8.1.60.0030.00517.64
8.1.50.0040.00817.43
8.1.40.0020.00517.52
8.1.30.0080.00017.59
8.1.20.0000.00717.48
8.1.10.0000.00817.63
8.1.00.0000.00817.55
8.0.300.0070.00022.00
8.0.290.0030.00516.75
8.0.280.0030.00318.52
8.0.270.0000.00717.92
8.0.260.0000.00716.80
8.0.250.0000.00716.92
8.0.240.0040.00416.98
8.0.230.0080.00016.92
8.0.220.0040.00416.77
8.0.210.0040.00416.85
8.0.200.0000.00717.02
8.0.190.0040.00416.95
8.0.180.0060.00316.98
8.0.170.0060.00316.80
8.0.160.0000.00716.93
8.0.150.0070.00016.91
8.0.140.0040.00416.86
8.0.130.0070.00013.39
8.0.120.0000.00816.77
8.0.110.0100.00016.85
8.0.100.0000.00816.95
8.0.90.0050.00216.96
8.0.80.0110.00816.93
8.0.70.0040.00416.75
8.0.60.0050.00216.71
8.0.50.0000.00716.96
8.0.30.0130.00617.04
8.0.20.0120.01317.40
8.0.10.0040.00416.92
8.0.00.0120.00816.87
7.4.330.0050.00015.55
7.4.320.0000.00616.53
7.4.300.0040.00416.50
7.4.290.0050.00316.52
7.4.280.0130.00016.59
7.4.270.0030.00316.52
7.4.260.0040.00316.49
7.4.250.0000.00716.57
7.4.240.0040.00416.48
7.4.230.0040.00416.72
7.4.220.0030.00616.58
7.4.210.0080.00816.58
7.4.200.0000.00716.63
7.4.160.0080.00916.55
7.4.140.0110.00617.86
7.4.130.0140.00316.39
7.4.120.0100.00916.52
7.4.110.0120.00616.45
7.4.100.0070.01616.46
7.4.90.0110.00716.59
7.4.80.0060.01219.39
7.4.70.0070.01016.64
7.4.60.0070.01316.61
7.4.50.0090.00316.34
7.4.40.0130.00316.69
7.4.00.0070.01114.65
7.3.330.0050.00013.30
7.3.320.0020.00213.16
7.3.310.0000.00716.37
7.3.300.0030.00316.34
7.3.290.0030.00316.13
7.3.280.0070.00816.30
7.3.260.0120.00916.39
7.3.240.0080.00916.44
7.3.230.0100.00616.62
7.3.210.0120.00616.48
7.3.200.0060.00916.70
7.3.190.0140.00416.51
7.3.180.0090.00916.23
7.3.170.0070.01116.28
7.3.160.0130.01116.28
7.2.330.0100.01316.72
7.2.320.0030.01416.75
7.2.310.0060.01216.57
7.2.300.0060.01216.75
7.2.290.0140.00716.67
7.2.100.1480.01014.85
7.2.90.1190.00614.66
7.2.80.1050.00314.24
7.2.70.1370.01014.89
7.2.60.1340.00015.14
7.2.50.1420.00614.91
7.2.40.1310.00314.84
7.2.30.1400.01014.86
7.2.20.1350.00714.83
7.2.10.1830.00314.89
7.2.00.1850.00914.95
7.1.220.1220.00913.96
7.1.210.1620.00613.66
7.1.200.1370.00613.57
7.1.190.1200.01013.98
7.1.180.1350.00313.86
7.1.170.1440.00313.75
7.1.160.1170.01013.82
7.1.150.1250.01013.94
7.1.140.1420.00713.88
7.1.130.0930.00713.71
7.1.120.1310.00314.04
7.1.110.1210.00713.85
7.1.100.1390.00313.64
7.1.90.1860.01313.60
7.1.80.1710.01013.75
7.1.70.1550.01013.73
7.1.60.2020.00731.84
7.1.50.1850.01331.87
7.1.40.2250.02231.68
7.1.30.2280.01631.89
7.1.20.1670.01631.43
7.1.10.1490.01013.97
7.1.00.1180.00913.95

preferences:
29.97 ms | 403 KiB | 5 Q