3v4l.org

run code in 300+ PHP versions simultaneously
<?php function alphabetize_custom($a, $b) { $alphabet = [' ', '-', ',', '.', 'ȝ', 'j', 'ʿ', 'w', 'b', 'p', 'f', 'm', 'n', 'r', 'h', 'ḥ', 'ḫ', 'ẖ', 's', 'š', 'q', 'k', 'g', 't', 'ṯ', 'd', 'ḏ', '⸗', '/', '(', ')', '[', ']', '<', '>', '{', '}', "'", '*', '#', 'I', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '&', '@', '%']; unset($alphabet[0]); // removes dummy first key, effectively starting the keys from 1 $encoding = 'UTF-8'; $mb_length = max(mb_strlen($a, $encoding), mb_strlen($b, $encoding)); for ($i = 0; $i < $mb_length; ++$i) { $a_char = mb_substr($a, $i, 1, $encoding); $b_char = mb_substr($b, $i, 1, $encoding); if ($a_char === $b_char) continue; $a_key = array_search($a_char, $alphabet); $b_key = array_search($b_char, $alphabet); if ($a_key === $b_key) continue; return $a_key - $b_key; } return 0; } $result = [ "nṯr" => ["Ka.C.Coptite.urkVIII,176b", "Ka.C.Coptite.urkVIII,177,1"], "n" => ["Ka.C.Coptite.urkVIII,176c", "Ka.C.Coptite.urkVIII,177,1", "Ka.C.Coptite.urkVIII,177,2"], "nḫȝḫȝ" => ["Ka.C.Coptite.urkVIII,176c"], "nwj" => ["Ka.C.Coptite.urkVIII,176c"], "nfr" => ["Ka.C.Coptite.urkVIII,176c", "Ka.C.Coptite.urkVIII,177,2"], "nḥḥ" => ["Ka.C.Coptite.urkVIII,176e", "Ka.C.Coptite.urkVIII,177,1", "Ka.C.Coptite.urkVIII,177,1"], "nḏ" => ["Ka.C.Coptite.urkVIII,177,1"] ]; uksort($result, 'alphabetize_custom'); var_export($result);

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.40.0080.00818.85
8.3.30.0110.00418.86
8.3.20.0070.00021.73
8.3.10.0050.00221.76
8.3.00.0040.00419.80
8.2.170.0040.01122.96
8.2.160.0070.00721.13
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00919.24
8.2.120.0050.00226.35
8.2.110.0090.00021.02
8.2.100.0090.00317.83
8.2.90.0030.00518.03
8.2.80.0030.00618.05
8.2.70.0090.00018.05
8.2.60.0050.00318.22
8.2.50.0040.00418.15
8.2.40.0040.00420.66
8.2.30.0000.00719.19
8.2.20.0050.00218.05
8.2.10.0000.00818.01
8.2.00.0000.00718.11
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0030.00722.04
8.1.230.0130.00022.63
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0040.00417.35
8.1.190.0000.00917.23
8.1.180.0080.00018.10
8.1.170.0080.00018.57
8.1.160.0040.00418.82
8.1.150.0040.00418.96
8.1.140.0000.00817.68
8.1.130.0040.00419.10
8.1.120.0000.00717.51
8.1.110.0040.00417.32
8.1.100.0030.00617.38
8.1.90.0050.00317.30
8.1.80.0080.00017.36
8.1.70.0040.00417.26
8.1.60.0050.00517.58
8.1.50.0000.00917.55
8.1.40.0000.00817.54
8.1.30.0000.00817.71
8.1.20.0050.00217.66
8.1.10.0030.00617.64
8.1.00.0040.00417.52
8.0.300.0070.00020.29
8.0.290.0030.00616.72
8.0.280.0000.00718.36
8.0.270.0000.00717.26
8.0.260.0030.00317.30
8.0.250.0030.00316.93
8.0.240.0030.00616.99
8.0.230.0040.00416.99
8.0.220.0070.00016.98
8.0.210.0000.00716.88
8.0.200.0040.00416.92
8.0.190.0040.00417.07
8.0.180.0030.00316.91
8.0.170.0090.00017.01
8.0.160.0060.00317.04
8.0.150.0000.00816.92
8.0.140.0000.00716.96
8.0.130.0000.00513.42
8.0.120.0000.00716.87
8.0.110.0040.00416.99
8.0.100.0000.00717.01
8.0.90.0000.00816.97
8.0.80.0060.01017.05
8.0.70.0040.00417.11
8.0.60.0080.00016.98
8.0.50.0050.00216.96
8.0.30.0100.00917.13
8.0.20.0040.01517.42
8.0.10.0020.00516.93
8.0.00.0150.00316.76
7.4.330.0000.00415.55
7.4.320.0000.00616.47
7.4.300.0030.00316.56
7.4.290.0030.00316.59
7.4.280.0000.00816.65
7.4.270.0030.00516.49
7.4.260.0070.00016.53
7.4.250.0070.00016.56
7.4.240.0040.00416.68
7.4.230.0030.00516.66
7.4.220.0000.00816.71
7.4.210.0110.00416.60
7.4.200.0000.00716.48
7.4.160.0050.01116.54
7.4.140.0090.01017.86
7.4.130.0070.01116.60
7.4.120.0100.00716.56
7.4.110.0100.00716.66
7.4.100.0120.00616.61
7.4.90.0060.01216.56
7.4.80.0090.01219.39
7.4.70.0060.01116.52
7.4.60.0000.01616.64
7.4.50.0150.00016.50
7.4.40.0070.01016.64
7.4.00.0040.01415.13
7.3.330.0000.00513.34
7.3.320.0000.00713.37
7.3.310.0030.00316.40
7.3.300.0000.00716.38
7.3.290.0030.00316.42
7.3.280.0070.01516.36
7.3.260.0140.01116.37
7.3.240.0130.00516.42
7.3.230.0110.01116.58
7.3.210.0060.01016.31
7.3.200.0150.00316.50
7.3.190.0140.00316.62
7.3.180.0100.00616.55
7.3.170.0130.00316.36
7.3.160.0070.01016.64
7.3.10.0090.00416.81
7.3.00.0070.00716.50
7.2.330.0140.00316.72
7.2.320.0100.01716.35
7.2.310.0040.01416.55
7.2.300.0150.00716.67
7.2.290.0160.00216.57
7.2.130.0100.00717.06
7.2.120.0070.00317.00
7.2.110.0040.01217.00
7.2.100.0060.00916.96
7.2.90.0080.00316.93
7.2.80.0070.01016.82
7.2.70.0070.00317.09
7.2.60.0080.00616.76
7.2.50.0100.00716.95
7.2.40.0350.00917.36
7.2.30.0350.00717.49
7.2.20.0370.00817.47
7.2.10.0400.01117.55
7.2.00.0250.01117.21
7.1.250.0030.01315.90
7.1.200.0080.00415.70
7.1.160.0630.01416.93
7.1.150.0640.01416.77
7.1.140.1080.01416.92
7.1.130.0600.01517.04
7.1.120.0590.01317.09
7.1.110.0730.01016.25
7.1.100.0590.01016.57
7.1.90.0490.00916.28
7.1.80.0600.01316.01
7.1.70.0430.00815.53
7.1.60.0740.01333.50
7.1.50.0930.01933.23
7.1.40.0800.01632.83
7.1.30.0770.01832.84
7.1.20.1100.01733.04
7.1.10.0550.01214.90
7.1.00.1190.01314.97

preferences:
57.52 ms | 400 KiB | 5 Q