3v4l.org

run code in 300+ PHP versions simultaneously
<?php function alphabetize_custom($a, $b, $alphabet = " -,.ȝjʿwbpfmnrhḥḫẖsšqkgtṯdḏ⸗/()[]<>{}'*#I0123456789&@%", $encoding = 'UTF-8') { //echo "\n----\n$a =vs= $b"; $mb_length = max(mb_strlen($a, $encoding), mb_strlen($b, $encoding)); for ($i = 0; $i < $mb_length; ++$i) { //echo "\n"; $a_char = mb_substr($a, $i, 1, $encoding); $b_char = mb_substr($b, $i, 1, $encoding); //echo "$a_char -vs- $b_char\n"; //echo "(" , mb_strlen($a_char, $encoding), " & ", mb_strlen($b_char, $encoding), ")\n"; if ($a_char === $b_char) {echo "identical, continue"; continue;} if (!mb_strlen($a_char, $encoding)) { /* echo "a is empty -1";*/ return -1;} if (!mb_strlen($b_char, $encoding)) { /*echo "b is empty 1";*/ return 1;} $a_offset = mb_strpos($alphabet, $a_char, 0, $encoding); $b_offset = mb_strpos($alphabet, $b_char, 0, $encoding); //echo "[" , $a_offset, " & ", $b_offset, "]\n"; if ($a_offset == $b_offset) { /*echo "== offsets, continue";*/ continue;} if ($a_offset < $b_offset) { /*echo "a offset -1";*/ return -1;} //echo "b offset 1"; return 1; } //echo "0"; 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.60.0160.00318.24
8.3.50.0110.00317.98
8.3.40.0040.01118.81
8.3.30.0040.01118.53
8.3.20.0050.00321.85
8.3.10.0050.00323.48
8.3.00.0080.00019.37
8.2.180.0030.01318.14
8.2.170.0070.00722.96
8.2.160.0100.01020.36
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00421.04
8.2.120.0080.00026.35
8.2.110.0110.01120.74
8.2.100.0080.00417.78
8.2.90.0080.00017.90
8.2.80.0080.00019.09
8.2.70.0040.00417.80
8.2.60.0000.00917.80
8.2.50.0020.00518.22
8.2.40.0040.00420.55
8.2.30.0040.00419.47
8.2.20.0080.00018.03
8.2.10.0000.00718.25
8.2.00.0040.00418.15
8.1.280.0090.00925.92
8.1.270.0090.00023.73
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0030.00722.54
8.1.230.0030.00920.91
8.1.220.0040.00417.78
8.1.210.0030.00619.03
8.1.200.0060.00317.36
8.1.190.0000.00917.13
8.1.180.0040.00418.10
8.1.170.0060.00318.66
8.1.160.0000.00718.79
8.1.150.0000.00718.96
8.1.140.0000.00717.76
8.1.130.0070.00019.04
8.1.120.0040.00417.47
8.1.110.0000.00717.38
8.1.100.0040.00417.38
8.1.90.0040.00417.52
8.1.80.0040.00417.39
8.1.70.0030.00717.46
8.1.60.0080.00317.57
8.1.50.0030.00617.61
8.1.40.0050.00317.50
8.1.30.0030.00517.67
8.1.20.0050.00417.63
8.1.10.0000.01017.52
8.1.00.0000.00817.45
8.0.300.0060.00320.04
8.0.290.0000.00716.63
8.0.280.0040.00418.54
8.0.270.0030.00317.41
8.0.260.0000.00817.06
8.0.250.0030.00517.07
8.0.240.0040.00416.99
8.0.230.0070.00316.93
8.0.220.0070.00016.98
8.0.210.0000.00716.89
8.0.200.0070.00017.00
8.0.190.0040.00717.06
8.0.180.0050.00216.89
8.0.170.0050.00316.93
8.0.160.0050.00217.05
8.0.150.0040.00416.95
8.0.140.0000.00716.88
8.0.130.0000.00613.39
8.0.120.0040.00416.91
8.0.110.0070.00016.92
8.0.100.0000.00716.93
8.0.90.0040.00416.90
8.0.80.0060.01017.05
8.0.70.0020.00516.77
8.0.60.0000.00816.98
8.0.50.0080.00016.96
8.0.30.0130.00617.00
8.0.20.0070.01317.40
8.0.10.0050.00217.00
8.0.00.0100.00816.97
7.4.330.0040.00015.55
7.4.320.0060.00016.51
7.4.300.0000.00616.48
7.4.290.0000.00716.63
7.4.280.0000.00816.64
7.4.270.0000.00716.68
7.4.260.0050.00316.45
7.4.250.0030.00416.54
7.4.240.0040.00416.61
7.4.230.0040.00416.73
7.4.220.0000.00716.28
7.4.210.0090.00516.65
7.4.200.0020.00516.69
7.4.160.0100.00816.53
7.4.140.0110.00917.86
7.4.130.0130.01016.36
7.4.120.0070.01116.64
7.4.110.0130.00916.44
7.4.100.0060.01316.44
7.4.90.0130.01116.53
7.4.80.0030.01719.39
7.4.70.0160.00416.46
7.4.60.0100.00716.50
7.4.50.0030.01316.28
7.4.40.0130.00416.49
7.4.00.0090.00014.88
7.3.330.0000.00513.34
7.3.320.0000.00613.46
7.3.310.0040.00416.29
7.3.300.0070.00016.43
7.3.290.0000.00716.43
7.3.280.0110.00816.43
7.3.260.0120.00716.38
7.3.240.0100.00716.50
7.3.230.0100.00716.47
7.3.210.0060.01216.26
7.3.200.0140.01116.73
7.3.190.0160.00016.41
7.3.180.0050.01316.49
7.3.170.0070.01016.64
7.3.160.0130.01016.25
7.2.330.0120.00616.56
7.2.320.0100.01316.71
7.2.310.0170.00716.43
7.2.300.0100.00616.68
7.2.290.0110.01116.70
7.2.60.0070.00716.69
7.2.40.1190.01018.00
7.2.30.1160.01418.14
7.2.20.1190.01317.93
7.2.10.1540.01617.96
7.2.00.1130.01417.97
7.1.200.0000.01215.50
7.1.160.1230.00916.61
7.1.150.1680.01216.57
7.1.140.1130.00916.72
7.1.130.1240.01117.19
7.1.120.1020.01016.71
7.1.110.1250.00916.31
7.1.100.1060.00716.29
7.1.90.1450.01216.13
7.1.80.1440.01416.15
7.1.70.1780.01415.11
7.1.60.1940.01433.38
7.1.50.1740.01733.17
7.1.40.1680.01932.74
7.1.30.1220.01332.90
7.1.20.1420.01932.84
7.1.10.1110.01014.74
7.1.00.1820.01314.88

preferences:
33.76 ms | 400 KiB | 5 Q