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.0120.00618.31
8.3.50.0100.01017.91
8.3.40.0080.00818.71
8.3.30.0090.01318.71
8.3.20.0070.00021.77
8.3.10.0080.00023.56
8.3.00.0000.00819.54
8.2.180.0110.01118.13
8.2.170.0150.00618.91
8.2.160.0100.00322.96
8.2.150.0090.00025.66
8.2.140.0080.00024.66
8.2.130.0030.00521.18
8.2.120.0000.00826.35
8.2.110.0090.00022.29
8.2.100.0040.00817.72
8.2.90.0040.00718.02
8.2.80.0040.00417.97
8.2.70.0050.00318.04
8.2.60.0060.00318.16
8.2.50.0000.00918.22
8.2.40.0040.00422.22
8.2.30.0050.00219.37
8.2.20.0080.00018.07
8.2.10.0000.00718.15
8.2.00.0000.00818.18
8.1.280.0090.00625.92
8.1.270.0030.00621.93
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00322.07
8.1.230.0040.00820.93
8.1.220.0060.00317.74
8.1.210.0030.00618.77
8.1.200.0040.00417.48
8.1.190.0000.00917.35
8.1.180.0080.00018.10
8.1.170.0080.00018.49
8.1.160.0050.00218.83
8.1.150.0000.00719.04
8.1.140.0000.00817.70
8.1.130.0000.00719.05
8.1.120.0040.00417.38
8.1.110.0030.00517.49
8.1.100.0050.00317.41
8.1.90.0040.00417.49
8.1.80.0040.00417.52
8.1.70.0030.00717.55
8.1.60.0070.00417.68
8.1.50.0050.00317.61
8.1.40.0040.00417.49
8.1.30.0040.00417.75
8.1.20.0000.01017.64
8.1.10.0060.00317.59
8.1.00.0000.00817.52
8.0.300.0030.00720.10
8.0.290.0000.00916.75
8.0.280.0040.00418.54
8.0.270.0030.00316.79
8.0.260.0000.00717.34
8.0.250.0000.00716.95
8.0.240.0030.00617.00
8.0.230.0030.00617.07
8.0.220.0040.00416.91
8.0.210.0050.00216.92
8.0.200.0040.00417.05
8.0.190.0110.00017.03
8.0.180.0000.00816.90
8.0.170.0040.00417.02
8.0.160.0000.00716.88
8.0.150.0040.00416.98
8.0.140.0050.00216.95
8.0.130.0000.00613.42
8.0.120.0060.00316.85
8.0.110.0050.00216.89
8.0.100.0000.00716.93
8.0.90.0040.00416.95
8.0.80.0100.00316.91
8.0.70.0040.00416.88
8.0.60.0030.00516.84
8.0.50.0070.00017.02
8.0.30.0100.01017.23
8.0.20.0130.00917.40
8.0.10.0040.00416.99
8.0.00.0060.01116.95
7.4.330.0050.00015.55
7.4.320.0000.00716.55
7.4.300.0030.00316.63
7.4.290.0040.00416.66
7.4.280.0040.00416.64
7.4.270.0030.00316.58
7.4.260.0030.00316.42
7.4.250.0050.00216.64
7.4.240.0070.00016.68
7.4.230.0030.00316.66
7.4.220.0060.00316.38
7.4.210.0050.00916.54
7.4.200.0070.00016.51
7.4.160.0080.00916.59
7.4.140.0090.01117.86
7.4.130.0090.00716.44
7.4.120.0090.01016.55
7.4.110.0120.01016.63
7.4.100.0120.01216.60
7.4.90.0120.00916.47
7.4.80.0030.01619.39
7.4.70.0120.00716.58
7.4.60.0030.01316.52
7.4.50.0070.01116.54
7.4.40.0150.00316.32
7.4.00.0070.01015.00
7.3.330.0000.00513.13
7.3.320.0030.00313.25
7.3.310.0000.00716.43
7.3.300.0030.00316.43
7.3.290.0030.00316.30
7.3.280.0090.01116.40
7.3.260.0110.01216.51
7.3.240.0080.01216.50
7.3.230.0100.00716.68
7.3.210.0070.01016.45
7.3.200.0070.01216.38
7.3.190.0120.00416.56
7.3.180.0090.00916.38
7.3.170.0100.00616.69
7.3.160.0080.00816.69
7.3.120.0060.00914.85
7.3.110.0040.01114.95
7.3.100.0080.00814.94
7.3.90.0030.00915.14
7.3.80.0080.00314.80
7.3.70.0000.01514.89
7.3.60.0140.00014.67
7.3.50.0030.01014.74
7.3.40.0030.01314.77
7.3.30.0090.00314.57
7.3.20.0000.00916.83
7.3.10.0060.01216.53
7.3.00.0040.00816.55
7.2.330.0030.02016.75
7.2.320.0070.01516.68
7.2.310.0070.01116.81
7.2.300.0130.00416.57
7.2.290.0100.00716.68
7.2.240.0000.01415.03
7.2.230.0000.01315.13
7.2.220.0100.00715.20
7.2.210.0070.00715.23
7.2.200.0030.00714.88
7.2.190.0070.00715.07
7.2.180.0080.00814.90
7.2.170.0150.00014.83
7.2.160.0060.00914.68
7.2.150.0070.01017.02
7.2.140.0000.01517.02
7.2.130.0040.01216.79
7.2.120.0080.00316.79
7.2.110.0000.01016.94
7.2.100.0070.01016.86
7.2.90.0070.00716.60
7.2.80.0090.00617.10
7.2.70.0120.00317.02
7.2.60.0050.00816.72
7.2.50.0030.01016.95
7.2.40.0890.01117.48
7.2.30.0880.01117.57
7.2.20.0700.01017.47
7.2.10.0690.00917.62
7.2.00.0640.01317.32
7.1.330.0040.01115.71
7.1.320.0000.01615.87
7.1.310.0100.00615.94
7.1.300.0070.00715.86
7.1.290.0110.00415.88
7.1.280.0040.01115.87
7.1.270.0030.01215.81
7.1.260.0060.00915.79
7.1.250.0070.00715.78
7.1.200.0000.00715.86
7.1.160.1270.01316.74
7.1.150.1540.01616.97
7.1.140.1530.01316.84
7.1.130.1010.01116.74
7.1.120.1130.01216.72
7.1.110.2090.00916.06
7.1.100.1140.01116.38
7.1.90.0990.01016.18
7.1.80.0880.01016.15
7.1.70.1240.01115.33
7.1.60.1090.01533.38
7.1.50.2100.01732.99
7.1.40.1880.01532.59
7.1.30.1980.01632.79
7.1.20.1840.01932.71
7.1.10.1290.01514.76
7.1.00.1240.01114.99

preferences:
54.62 ms | 401 KiB | 5 Q